def mean(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.mean(data, axis=<NUM_LIT:0>)<EOL><DEDENT>elif units is False and time is True:<EOL><INDENT>return np.mean(data, axis=<NUM_LIT:1>)<EOL><DEDENT>elif units is True and time is True:<EOL><INDENT>return np.mean(data)<EOL><DEDENT>
Function to compute mean of data


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


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


Examples
--------
>>> mean(np.array([[1, 2, 3], [4, 5, 6]]), units=True)
array([ 2.5,  3.5,  4.5])

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

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