code: def test_compute_psd_errors(raw):
      """Test for expected errors in the .compute_psd() method."""
      with pytest.raises(
          ValueError, match="must not exceed ½ the sampling"
      ):
          raw.compute_psd(fmax=raw.info["sfreq"] * 0.51)
      with pytest.raises(
          TypeError, match="unexpected keyword argument foo for"
      ):
          raw.compute_psd(foo=None)
      with pytest.raises(
          TypeError, match="keyword arguments foo, bar for"
      ):
          raw.compute_psd(foo=None, bar=None)
      with pytest.raises(
          ValueError, match="Complex output is not supported in "
      ):
          raw.compute_psd(output="complex")
  
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 1 for calling a global function with example usage: test_compute_psd_errors(raw) without return types