code: def _add_noise(
      inst, cov, iir_filter, random_state, allow_subselection=True
  ):
      """Add noise, possibly with channel subselection."""
      _validate_type(cov, Covariance, "cov")
      _validate_type(
          inst,
          (BaseRaw, BaseEpochs, Evoked),
          "inst",
          "Raw, Epochs, or Evoked",
      )
      _check_preload(inst, "Adding noise")
      data = inst._data
      assert data.ndim in (2, 3)
      if data.ndim == 2:
          data = data[np.newaxis]
      # Subselect if necessary
      info = inst.info
      info._check_consistency()
      picks = gen_picks = slice(None)
      if allow_subselection:
          use_chs = list(set(info["ch_names"]) & set(cov["names"]))
          picks = np.where(np.isin(info["ch_names"], use_chs))[0]
          logger.info(
              "Adding noise to %d/%d channels (%d channels in cov)"
              % (len(picks), len(info["chs"]), len(cov["names"]))
          )
          info = pick_info(inst.info, picks)
          info._check_consistency()
  
          gen_picks = np.arange(info["nchan"])
      for epoch in data:
          epoch[picks] += _generate_noise(
              info,
              cov,
              iir_filter,
              random_state,
              epoch.shape[1],
              picks=gen_picks,
          )[0]
      return inst
  
file_path: mne-python/mne/simulation/evoked.py
imports: import math
  import numpy
  from scipy.signal import lfilter
  from .._fiff.pick import pick_info
  from ..cov import Covariance, compute_whitener
  from ..epochs import BaseEpochs
  from ..evoked import Evoked
  from ..forward import apply_forward
  from ..io import BaseRaw
  from ..utils import _check_preload, _validate_type, check_random_state, logger, verbose
label_desc: Use image node_id 4 for calling a global function with example usage: _add_noise(inst, cov, iir_filter, random_state, allow_subselection) and returns: inst