code: def test_unit_noise_gain_formula(
      pick_ori, weight_norm, reg, inversion
  ):
      """Test unit-noise-gain filter against formula."""
      raw = mne.io.read_raw_fif(fname_raw, preload=True)
      events = mne.find_events(raw)
      raw.pick(picks="mag")
      assert len(raw.ch_names) == 102
      epochs = mne.Epochs(raw, events, None, preload=True)
      data_cov = mne.compute_covariance(epochs, tmin=0.04, tmax=0.15)
      # for now, avoid whitening to make life easier
      noise_cov = mne.make_ad_hoc_cov(
          epochs.info, std=dict(grad=1.0, mag=1.0)
      )
      forward = mne.read_forward_solution(fname_fwd)
      convert_forward_solution(forward, surf_ori=True, copy=False)
      rank = None
      kwargs = dict(
          reg=reg,
          noise_cov=noise_cov,
          pick_ori=pick_ori,
          weight_norm=weight_norm,
          rank=rank,
          inversion=inversion,
      )
      if (
          inversion == "single"
          and pick_ori == "vector"
          and weight_norm == "unit-noise-gain-invariant"
      ):
          with pytest.raises(ValueError, match="Cannot use"):
              make_lcmv(epochs.info, forward, data_cov, **kwargs)
          return
      filters = make_lcmv(epochs.info, forward, data_cov, **kwargs)
      _, _, _, _, G, _, _, _ = _prepare_beamformer_input(
          epochs.info,
          forward,
          None,
          "vector",
          noise_cov=noise_cov,
          rank=rank,
          pca=False,
          exp=None,
      )
      n_channels, n_sources = G.shape
      n_sources //= 3
      G.shape = (n_channels, n_sources, 3)
      G = G.transpose(1, 2, 0)  # verts, orient, ch
      _assert_weight_norm(filters, G)
  
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 15 for calling a global function with example usage: test_unit_noise_gain_formula(pick_ori, weight_norm, reg, inversion) without return types