'Filter data along the last dimension.
Parameters
X : array, shape (n_epochs, n_channels, n_times) or shape (n_channels, n_times) # noqa
The data to be filtered over the last dimension. The channels
dimension can be zero when passing a 2D array.
Returns
X : array, shape is same as used in input.
The data after filtering.'

def transform(self, X):

    X = np.atleast_2d(X)
    if (X.ndim > 3):
        raise ValueError(('Array    must    be    of    at    max    3    dimensions    instead    got    %s    dimensional    matrix' % X.ndim))
    shape = X.shape
    X = X.reshape((-1), shape[(-1)])
    (X, self.sfreq, self.l_freq, self.h_freq, self.l_trans_bandwidth, self.h_trans_bandwidth, self.filter_length, _, self.fir_window, self.fir_design) = _triage_filter_params(X, self.sfreq, self.l_freq, self.h_freq, self.l_trans_bandwidth, self.h_trans_bandwidth, self.filter_length, self.method, phase='zero', fir_window=self.fir_window, fir_design=self.fir_design)
    X = filter_data(X, self.sfreq, self.l_freq, self.h_freq, filter_length=self.filter_length, l_trans_bandwidth=self.l_trans_bandwidth, h_trans_bandwidth=self.h_trans_bandwidth, n_jobs=self.n_jobs, method=self.method, iir_params=self.iir_params, copy=False, fir_window=self.fir_window, fir_design=self.fir_design, verbose=self.verbose)
    return X.reshape(shape)
