code: def _prepare_noise_csd(csd, noise_csd, real_filter):
      if noise_csd is not None:
          csd, noise_csd = equalize_channels([csd, noise_csd])
          # Use the same noise CSD for all frequencies
          if len(noise_csd.frequencies) > 1:
              noise_csd = noise_csd.mean()
          noise_csd = noise_csd.get_data(as_cov=True)
          if real_filter:
              noise_csd["data"] = noise_csd["data"].real
      return csd, noise_csd
  
file_path: mne-python/mne/beamformer/_dics.py
imports: import numpy
  from .._fiff.pick import pick_channels, pick_info
  from ..channels import equalize_channels
  from ..forward import _subject_from_forward
  from ..minimum_norm.inverse import _check_depth, _check_reference, combine_xyz
  from ..rank import compute_rank
  from ..source_estimate import _get_src_type, _make_stc
  from ..time_frequency import EpochsTFR
  from ..time_frequency.tfr import _check_tfr_complex
  from ..utils import _check_channels_spatial_filter, _check_one_ch_type, _check_option, _check_rank, _validate_type, logger, verbose, warn
  from ._compute_beamformer import Beamformer, _check_src_type, _compute_beamformer, _compute_power, _prepare_beamformer_input, _proj_whiten_data
label_desc: Use image node_id 2 for calling a global function with example usage: _prepare_noise_csd(csd, noise_csd, real_filter) and returns: csd,  noise_csd