code: def compute_source_psd_epochs(
      epochs,
      inverse_operator,
      lambda2=1.0 / 9.0,
      method="dSPM",
      fmin=0.0,
      fmax=200.0,
      pick_ori=None,
      label=None,
      nave=1,
      pca=True,
      inv_split=None,
      bandwidth=4.0,
      adaptive=False,
      low_bias=True,
      return_generator=False,
      n_jobs=None,
      prepared=False,
      method_params=None,
      return_sensor=False,
      use_cps=True,
      verbose=None,
  ):
      """Compute source power spectral density (PSD) from Epochs.
  
      This uses the multi-taper method to compute the PSD for each epoch.
  
      Parameters
      ----------
      epochs : instance of Epochs
          The raw data.
      inverse_operator : instance of InverseOperator
          The inverse operator.
      lambda2 : float
          The regularization parameter.
      method : "MNE" | "dSPM" | "sLORETA" | "eLORETA"
          Use minimum norm, dSPM (default), sLORETA, or eLORETA.
      fmin : float
          The lower frequency of interest.
      fmax : float
          The upper frequency of interest.
      pick_ori : None | "normal"
          If "normal", rather than pooling the orientations by taking the norm,
          only the radial component is kept. This is only implemented
          when working with loose orientations.
      label : Label
          Restricts the source estimates to a given label.
      nave : int
          The number of averages used to scale the noise covariance matrix.
      pca : bool
          If True, the true dimension of data is estimated before running
          the time-frequency transforms. It reduces the computation times
          e.g. with a dataset that was maxfiltered (true dim is 64).
      inv_split : int or None
          Split inverse operator into inv_split parts in order to save memory.
      bandwidth : float | str
          The bandwidth of the multi taper windowing function in Hz.
          Can also be a string (e.g., 'hann') to use a single window.
      adaptive : bool
          Use adaptive weights to combine the tapered spectra into PSD
          (slow, use n_jobs >> 1 to speed up computation).
      low_bias : bool
          Only use tapers with more than 90%% spectral concentration within
          bandwidth.
      return_generator : bool
          Return a generator object instead of a list. This allows iterating
          over the stcs without having to keep them all in memory.
      %(n_jobs)s
          It is only used if adaptive=True.
      prepared : bool
          If True, do not call :func:`prepare_inverse_operator`.
      method_params : dict | None
          Additional options for eLORETA. See Notes of :func:`apply_inverse`.
  
          .. versionadded:: 0.16
      return_sensor : bool
          If True, also return the sensor PSD for each epoch as an EvokedArray.
  
          .. versionadded:: 0.17
      %(use_cps_restricted)s
  
          .. versionadded:: 0.20
      %(verbose)s
  
      Returns
      -------
      out : list (or generator object)
          A list (or generator) for the source space PSD (and optionally the
          sensor PSD) for each epoch.
  
      See Also
      --------
      compute_source_psd
      """
      # use an auxiliary function so we can either return a generator or a list
      stcs_gen = _compute_source_psd_epochs(
          epochs,
          inverse_operator,
          lambda2=lambda2,
          method=method,
          fmin=fmin,
          fmax=fmax,
          pick_ori=pick_ori,
          label=label,
          nave=nave,
          pca=pca,
          inv_split=inv_split,
          bandwidth=bandwidth,
          adaptive=adaptive,
          low_bias=low_bias,
          n_jobs=n_jobs,
          prepared=prepared,
          method_params=method_params,
          return_sensor=return_sensor,
          use_cps=use_cps,
      )
  
      if return_generator:
          # return generator object
          return stcs_gen
      else:
          # return a list
          stcs = list()
          for stc in stcs_gen:
              stcs.append(stc)
  
          return stcs
  
imports: import numpy
  from .._fiff.constants import FIFF
  from .._fiff.pick import pick_info
  from ..baseline import _log_rescale, rescale
  from ..epochs import Epochs
  from ..event import make_fixed_length_events
  from ..evoked import EvokedArray
  from ..fixes import _safe_svd
  from ..label import BiHemiLabel, Label
  from ..parallel import parallel_func
  from ..source_estimate import _make_stc
  from ..time_frequency.multitaper import _compute_mt_params, _mt_spectra, _psd_from_mt, _psd_from_mt_adaptive
  from ..time_frequency.tfr import cwt, morlet
  from ..utils import ProgressBar, _check_option, _pl, _validate_type, logger, verbose
  from .inverse import INVERSE_METHODS, _assemble_kernel, _check_or_prepare, _check_ori, _pick_channels_inverse_operator, _subject_from_inverse, combine_xyz
label_desc: Use image node_id 12 for calling a global function with example usage: compute_source_psd_epochs(epochs, inverse_operator, lambda2, method, fmin, fmax, pick_ori, label, nave, pca, inv_split, bandwidth, adaptive, low_bias, return_generator, n_jobs, prepared, method_params, return_sensor, use_cps, verbose) and returns: stcs_gen, stcs