'Filter data.
Parameters
epochs_data : array, shape (n_epochs, n_channels, n_times)
The data.
y : array, shape (n_epochs,)
The label for each epoch.
Returns
self : instance of FilterEstimator
Returns the modified instance'

def fit(self, epochs_data, y):

    if (not isinstance(epochs_data, np.ndarray)):
        raise ValueError(('epochs_data    should    be    of    type    ndarray    (got    %s).' % type(epochs_data)))
    if (self.picks is None):
        self.picks = pick_types(self.info, meg=True, eeg=True, ref_meg=False, exclude=[])
    if (self.l_freq == 0):
        self.l_freq = None
    if ((self.h_freq is not None) and (self.h_freq > (self.info['sfreq'] / 2.0))):
        self.h_freq = None
    if ((self.l_freq is not None) and (not isinstance(self.l_freq, float))):
        self.l_freq = float(self.l_freq)
    if ((self.h_freq is not None) and (not isinstance(self.h_freq, float))):
        self.h_freq = float(self.h_freq)
    if ((self.info['lowpass'] is None) or ((self.h_freq is not None) and ((self.l_freq is None) or (self.l_freq < self.h_freq)) and (self.h_freq < self.info['lowpass']))):
        self.info['lowpass'] = self.h_freq
    if ((self.info['highpass'] is None) or ((self.l_freq is not None) and ((self.h_freq is None) or (self.l_freq < self.h_freq)) and (self.l_freq > self.info['highpass']))):
        self.info['highpass'] = self.l_freq
    return self
