code: def test_temporal_filter():
      """Test methods of TemporalFilter."""
      X = np.random.rand(5, 5, 1200)
  
      # Test init test
      values = (
          ("10hz", None, 100.0, "auto"),
          (5.0, "10hz", 100.0, "auto"),
          (10.0, 20.0, 5.0, "auto"),
          (None, None, 100.0, "5hz"),
      )
      for low, high, sf, ltrans in values:
          filt = TemporalFilter(
              low, high, sf, ltrans, fir_design="firwin"
          )
          pytest.raises(ValueError, filt.fit_transform, X)
  
      # Add tests for different combinations of l_freq and h_freq
      for low, high in ((5.0, 15.0), (None, 15.0), (5.0, None)):
          filt = TemporalFilter(
              low, high, sfreq=100.0, fir_design="firwin"
          )
          Xt = filt.fit_transform(X)
          assert_array_equal(filt.fit_transform(X), Xt)
          assert X.shape == Xt.shape
  
      # Test fit and transform numpy type check
      with pytest.raises(
          ValueError, match="Data to be filtered must be"
      ):
          filt.transform([1, 2])
  
      # Test with 2 dimensional data array
      X = np.random.rand(101, 500)
      filt = TemporalFilter(
          l_freq=25.0,
          h_freq=50.0,
          sfreq=1000.0,
          filter_length=150,
          fir_design="firwin2",
      )
      with use_log_level("error"):  # warning about transition bandwidth
          assert_equal(filt.fit_transform(X).shape, X.shape)
  
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 6 for calling a global function with example usage: test_temporal_filter() without return types