code: def test_psdestimator():
      """Test methods of PSDEstimator."""
      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)
      psd = PSDEstimator(2 * np.pi, 0, np.inf)
      y = epochs.events[:, -1]
      X = psd.fit_transform(epochs_data, y)
  
      assert X.shape[0] == epochs_data.shape[0]
      assert_array_equal(
          psd.fit(epochs_data, y).transform(epochs_data), X
      )
  
      # Test init exception
      pytest.raises(ValueError, psd.fit, epochs, y)
      pytest.raises(ValueError, psd.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 3 for calling a global function with example usage: test_psdestimator() without return types