def _crosscov(x, y, axis=-<NUM_LIT:1>, all_lags=False, debias=True):
if x.shape[axis] != y.shape[axis]:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>if debias:<EOL><INDENT>x = _remove_bias(x, axis)<EOL>y = _remove_bias(y, axis)<EOL><DEDENT>slicing = [slice(d) for d in x.shape]<EOL>slicing[axis] = slice(None,None,-<NUM_LIT:1>)<EOL>sxy = _fftconvolve(x, y[tuple(slicing)], axis=axis, mode='<STR_LIT>')<EOL>N = x.shape[axis]<EOL>sxy /= N<EOL>if all_lags:<EOL><INDENT>return sxy<EOL><DEDENT>slicing[axis] = slice(N-<NUM_LIT:1>,<NUM_LIT:2>*N-<NUM_LIT:1>)<EOL>return sxy[tuple(slicing)]<EOL>
Returns the crosscovariance sequence between two ndarrays.
    This is performed by calling fftconvolve on x, y[::-1]

    Parameters


    x: ndarray
    y: ndarray
    axis: time axis

    all_lags: {True/False}
    whether to return all nonzero lags, or to clip the length of s_xy
    to be the length of x and y. If False, then the zero lag covariance
    is at index 0. Otherwise, it is found at (len(x) + len(y) - 1)/2

    debias: {True/False}
    Always removes an estimate of the mean along the axis, unless
    told not to.


    cross covariance is defined as
    sxy[k] := E{X[t]*Y[t+k]}, where X,Y are zero mean random processes