code: def _gen_dics(active_win, baseline_win, epochs):
      freqs = np.logspace(np.log10(12), np.log10(30), 9)
      csd = csd_morlet(epochs, freqs, tmin=-1, tmax=1.5, decim=20)
      csd_baseline = csd_morlet(
          epochs,
          freqs,
          tmin=baseline_win[0],
          tmax=baseline_win[1],
          decim=20,
      )
      csd_ers = csd_morlet(
          epochs,
          freqs,
          tmin=active_win[0],
          tmax=active_win[1],
          decim=20,
      )
      filters = make_dics(
          epochs.info,
          fwd,
          csd.mean(),
          pick_ori="max-power",
          reduce_rank=True,
          real_filter=True,
          rank=rank,
      )
      stc_base, freqs = apply_dics_csd(csd_baseline.mean(), filters)
      stc_act, freqs = apply_dics_csd(csd_ers.mean(), filters)
      stc_act /= stc_base
      return stc_act
  
file_path: mne-python/examples/inverse/evoked_ers_source_power.py
imports: import numpy
  import mne
  from mne.beamformer import apply_dics_csd, apply_lcmv_cov, make_dics, make_lcmv
  from mne.cov import compute_covariance
  from mne.datasets import somato
  from mne.minimum_norm import apply_inverse_cov, make_inverse_operator
  from mne.time_frequency import csd_morlet
label_desc: Use image node_id 1 for calling a global function with example usage: _gen_dics(active_win, baseline_win, epochs) and returns: stc_act