def centralize(data, time=False, units=False):
assert(time is not False or units is not False)<EOL>res = copy.copy(data)<EOL>if time is True:<EOL><INDENT>res = np.array([x - np.mean(x) for x in res])<EOL><DEDENT>if units is True:<EOL><INDENT>res = np.array(res - np.mean(res, axis=<NUM_LIT:0>))<EOL><DEDENT>return res<EOL>
Function to subtract the mean across time and/or across units from data


Parameters
----------  
data : numpy.ndarray
    1D or 2D array containing time series, 1st index: unit, 2nd index: time
time : bool
    True: subtract mean across time.
units : bool
    True: subtract mean across units.


Returns
-------
numpy.ndarray
    1D or 0D array of centralized signal.