code: def test_filterestimator():
      """Test methods of FilterEstimator."""
      raw = io.read_raw_fif(raw_fname)
      events = read_events(event_name)
      picks = pick_types(
          raw.info,
          meg=True,
          stim=False,
          ecg=False,
          eog=False,
          exclude="bads",
      )
      picks = picks[1:13:3]
      epochs = Epochs(
          raw,
          events,
          event_id,
          tmin,
          tmax,
          picks=picks,
          baseline=(None, 0),
          preload=True,
      )
      epochs_data = epochs.get_data(copy=False)
  
      # Add tests for different combinations of l_freq and h_freq
      filt = FilterEstimator(epochs.info, l_freq=40, h_freq=80)
      y = epochs.events[:, -1]
      X = filt.fit_transform(epochs_data, y)
      assert X.shape == epochs_data.shape
      assert_array_equal(
          filt.fit(epochs_data, y).transform(epochs_data), X
      )
  
      filt = FilterEstimator(
          epochs.info,
          l_freq=None,
          h_freq=40,
          filter_length="auto",
          l_trans_bandwidth="auto",
          h_trans_bandwidth="auto",
      )
      y = epochs.events[:, -1]
      X = filt.fit_transform(epochs_data, y)
  
      filt = FilterEstimator(epochs.info, l_freq=1, h_freq=1)
      y = epochs.events[:, -1]
      with pytest.warns(RuntimeWarning, match="longer than the signal"):
          pytest.raises(ValueError, filt.fit_transform, epochs_data, y)
  
      filt = FilterEstimator(
          epochs.info,
          l_freq=40,
          h_freq=None,
          filter_length="auto",
          l_trans_bandwidth="auto",
          h_trans_bandwidth="auto",
      )
      X = filt.fit_transform(epochs_data, y)
  
      # Test init exception
      pytest.raises(ValueError, filt.fit, epochs, y)
      pytest.raises(ValueError, filt.transform, epochs)
  
file_path: mne-python/mne/decoding/tests/test_transformer.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, io, pick_types, read_events
  from mne.decoding import FilterEstimator, PSDEstimator, Scaler, TemporalFilter, UnsupervisedSpatialFilter, Vectorizer
  from mne.defaults import DEFAULTS
  from mne.utils import check_version, use_log_level
label_desc: Use image node_id 2 for calling a global function with example usage: test_filterestimator() without return types