def variance(data, units=False, time=False):
assert(units is not False or time is not False)<EOL>if units is True and time is False:<EOL><INDENT>return np.var(data, axis=<NUM_LIT:0>)<EOL><DEDENT>elif units is False and time is True:<EOL><INDENT>return np.var(data, axis=<NUM_LIT:1>)<EOL><DEDENT>elif units is True and time is True:<EOL><INDENT>return np.mean(np.var(data, axis=<NUM_LIT:1>))<EOL><DEDENT>
Compute the variance of data across time, units or both.


Parameters
---------- 
data : numpy.ndarray 
    1st axis unit, 2nd axis time.
units : bool 
    Variance across units
time : bool
    Average over time


Returns
---------- 
if units=False and time=False: 
    Exception
if units=True: 
    1 dim numpy.ndarray; time series     
if time=True:  
    1 dim numpy.ndarray; series of single unit variances across time
if units=True and time=True: 
    float; mean of single unit variances across time


Examples
----------
>>> variance(np.array([[1, 2, 3],[4, 5, 6]]), units=True)
array([ 2.25,  2.25,  2.25])

>>> variance(np.array([[1, 2, 3], [4, 5, 6]]), time=True)
array([ 0.66666667,  0.66666667])

>>> variance(np.array([[1, 2, 3], [4, 5, 6]]), units=True, time=True)
0.66666666666666663