code: def test_source_psd(method, pick_ori, pca):
      """Test source PSD computation from raw."""
      raw = read_raw_fif(fname_data)
      raw.crop(0, 5).load_data()
      inverse_operator = read_inverse_operator(fname_inv)
      fmin, fmax = 40, 65  # Hz
      n_fft = 512
  
      assert inverse_operator["source_ori"] == FIFF.FIFFV_MNE_FREE_ORI
  
      stc, ev = compute_source_psd(
          raw,
          inverse_operator,
          lambda2=1.0 / 9.0,
          method=method,
          fmin=fmin,
          fmax=fmax,
          pick_ori=pick_ori,
          n_fft=n_fft,
          overlap=0.0,
          return_sensor=True,
          pca=pca,
          dB=True,
      )
  
      assert ev.data.shape == (len(ev.info["ch_names"]), len(stc.times))
      assert ev.times[0] >= fmin
      assert ev.times[-1] <= fmax
      # Time max at line frequency (60 Hz in US)
      assert 58 <= ev.times[np.argmax(np.sum(ev.data, axis=0))] <= 61
      assert ev.nave == 2
  
      assert stc.shape[0] == inverse_operator["nsource"]
      assert stc.times[0] >= fmin
      assert stc.times[-1] <= fmax
      assert 58 <= stc.times[np.argmax(np.sum(stc.data, axis=0))] <= 61
  
      if method in ("sLORETA", "dSPM"):
          stc_dspm = stc
          stc_mne, _ = compute_source_psd(
              raw,
              inverse_operator,
              lambda2=1.0 / 9.0,
              method="MNE",
              fmin=fmin,
              fmax=fmax,
              pick_ori=pick_ori,
              n_fft=n_fft,
              overlap=0.0,
              return_sensor=True,
              dB=True,
          )
          # normalize each source point by its power after undoing the dB
          stc_dspm.data = 10 ** (stc_dspm.data / 10.0)
          stc_dspm /= stc_dspm.mean()
          stc_mne.data = 10 ** (stc_mne.data / 10.0)
          stc_mne /= stc_mne.mean()
          assert_allclose(stc_dspm.data, stc_mne.data, atol=1e-4)
  
file_path: mne-python/mne/minimum_norm/tests/test_time_frequency.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from mne import Epochs, find_events, pick_types
  from mne._fiff.constants import FIFF
  from mne.datasets import testing
  from mne.io import read_raw_fif
  from mne.label import BiHemiLabel, read_label
  from mne.minimum_norm import INVERSE_METHODS, apply_inverse_epochs, prepare_inverse_operator, read_inverse_operator
  from mne.minimum_norm.time_frequency import compute_source_psd, compute_source_psd_epochs, source_band_induced_power, source_induced_power
  from mne.time_frequency.multitaper import psd_array_multitaper
label_desc: Use image node_id 3 for calling a global function with example usage: test_source_psd(method, pick_ori, pca) without return types