code: def test_spectrum_getitem_raw(raw_spectrum):
      """Test Spectrum.__getitem__ for Raw-derived spectra."""
      want = raw_spectrum.get_data(slice(1, 3), fmax=7)
      freq_idx = np.searchsorted(raw_spectrum.freqs, 7)
      got = raw_spectrum[1:3, :freq_idx]
      assert_array_equal(want, got)
  
imports: from functools import partial
  import numpy
  import pytest
  from matplotlib.colors import same_color
  from numpy.testing import assert_array_equal
  from mne import Annotations
  from mne.time_frequency import read_spectrum
  from mne.time_frequency.spectrum import EpochsSpectrumArray, SpectrumArray
label_desc: Use image node_id 9 for calling a global function with example usage: test_spectrum_getitem_raw(raw_spectrum) without return types