This code implements the main methods described in Toker et al, "Consciousness is supported by near-critical slow cortical electrodynamics." Scripts included are for Lempel-Ziv complexity, the modified 0-1 chaos test, our modified stochasticity test, selection of low-pass filter frequency, and our new time-series estimate of proximity to edge-of-chaos criticality. Also included are data and code necessary to generate the figures in the main body of the paper.