code: def _get_data(
      tmin=-0.1,
      tmax=0.15,
      all_forward=True,
      epochs=True,
      epochs_preload=True,
      data_cov=True,
      proj=True,
  ):
      """Read in data used in tests."""
      label = mne.read_label(fname_label)
      events = mne.read_events(fname_event)
      raw = mne.io.read_raw_fif(fname_raw, preload=True)
      forward = mne.read_forward_solution(fname_fwd)
      if all_forward:
          forward_surf_ori = _read_forward_solution_meg(
              fname_fwd, surf_ori=True
          )
          forward_fixed = _read_forward_solution_meg(
              fname_fwd, force_fixed=True, surf_ori=True, use_cps=False
          )
          forward_vol = _read_forward_solution_meg(fname_fwd_vol)
      else:
          forward_surf_ori = None
          forward_fixed = None
          forward_vol = None
  
      event_id, tmin, tmax = 1, tmin, tmax
  
      # Setup for reading the raw data
      raw.info["bads"] = ["MEG 2443", "EEG 053"]  # 2 bad channels
      # Set up pick list: MEG - bad channels
      left_temporal_channels = read_vectorview_selection(
          "Left-temporal"
      )
      picks = mne.pick_types(
          raw.info, meg=True, selection=left_temporal_channels
      )
      picks = picks[::2]  # decimate for speed
      # add a couple channels we will consider bad
      bad_picks = [100, 101]
      bads = [raw.ch_names[pick] for pick in bad_picks]
      assert not any(pick in picks for pick in bad_picks)
      picks = np.concatenate([picks, bad_picks])
      raw.pick([raw.ch_names[ii] for ii in picks])
      del picks
  
      raw.info["bads"] = bads  # add more bads
      if proj:
          raw.info.normalize_proj()  # avoid projection warnings
      else:
          raw.del_proj()
  
      if epochs:
          # Read epochs
          epochs = mne.Epochs(
              raw,
              events,
              event_id,
              tmin,
              tmax,
              proj=True,
              baseline=(None, 0),
              preload=epochs_preload,
              reject=reject,
          )
          if epochs_preload:
              epochs.resample(200, npad=0)
          epochs.crop(0, None)
          evoked = epochs.average()
          info = evoked.info
      else:
          epochs = None
          evoked = None
          info = raw.info
  
      noise_cov = mne.read_cov(fname_cov)
      noise_cov["projs"] = []  # avoid warning
      noise_cov = mne.cov.regularize(
          noise_cov,
          info,
          mag=0.05,
          grad=0.05,
          eeg=0.1,
          proj=True,
          rank=None,
      )
      if data_cov:
          data_cov = mne.compute_covariance(
              epochs, tmin=0.04, tmax=0.145, verbose="error"
          )  # baseline warning
      else:
          data_cov = None
  
      return (
          raw,
          epochs,
          evoked,
          data_cov,
          noise_cov,
          label,
          forward,
          forward_surf_ori,
          forward_fixed,
          forward_vol,
      )
  
imports: from contextlib import nullcontext
  from copy import deepcopy
  from inspect import signature
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less
  from scipy import linalg
  from scipy.spatial.distance import cdist
  import mne
  from mne import EvokedArray, VolSourceEstimate, VolVectorSourceEstimate, compute_rank, convert_forward_solution, pick_channels_cov, read_forward_solution, read_vectorview_selection
  from mne._fiff.compensator import set_current_comp
  from mne._fiff.constants import FIFF
  from mne.beamformer import Beamformer, apply_lcmv, apply_lcmv_cov, apply_lcmv_epochs, apply_lcmv_raw, make_dics, make_lcmv, read_beamformer
  from mne.beamformer._compute_beamformer import _prepare_beamformer_input
  from mne.datasets import testing
  from mne.minimum_norm import apply_inverse, make_inverse_operator
  from mne.minimum_norm.tests.test_inverse import _assert_free_ori_match
  from mne.simulation import simulate_evoked
  from mne.transforms import apply_trans, invert_transform
  from mne.utils import _record_warnings, catch_logging, object_diff
label_desc: Use image node_id 2 for calling a global function with example usage: _get_data(tmin, tmax, all_forward, epochs, epochs_preload, data_cov, proj) and returns: raw,  epochs,  evoked,  data_cov,  noise_cov,  label,  forward,  forward_surf_ori,  forward_fixed,  forward_vol