code: def test_make_lcmv_sphere(pick_ori, weight_norm):
      """Test LCMV with sphere head model."""
      # unit-noise gain beamformer and orientation
      # selection and rank reduction of the leadfield
      _, _, evoked, data_cov, noise_cov, _, _, _, _, _ = _get_data(
          proj=True
      )
      assert "eeg" not in evoked
      assert "meg" in evoked
      sphere = mne.make_sphere_model(
          r0=(0.0, 0.0, 0.0), head_radius=0.080
      )
      src = mne.setup_volume_source_space(
          pos=25.0, sphere=sphere, mindist=5.0, exclude=2.0
      )
      fwd_sphere = mne.make_forward_solution(
          evoked.info, None, src, sphere
      )
  
      # Test that we get an error if not reducing rank
      with pytest.raises(ValueError, match="Singular matrix detected"):
          with pytest.warns(
              RuntimeWarning, match="positive semidefinite"
          ):
              make_lcmv(
                  evoked.info,
                  fwd_sphere,
                  data_cov,
                  reg=0.1,
                  noise_cov=noise_cov,
                  weight_norm=weight_norm,
                  pick_ori=pick_ori,
                  reduce_rank=False,
                  rank="full",
              )
  
      # Now let's reduce it
      filters = make_lcmv(
          evoked.info,
          fwd_sphere,
          data_cov,
          reg=0.1,
          noise_cov=noise_cov,
          weight_norm=weight_norm,
          pick_ori=pick_ori,
          reduce_rank=True,
      )
      stc_sphere = apply_lcmv(evoked, filters)
      if isinstance(stc_sphere, VolVectorSourceEstimate):
          stc_sphere = stc_sphere.magnitude()
      else:
          stc_sphere = abs(stc_sphere)
      assert isinstance(stc_sphere, VolSourceEstimate)
      stc_sphere.crop(0.02, None)
  
      stc_pow = np.sum(stc_sphere.data, axis=1)
      idx = np.argmax(stc_pow)
      max_stc = stc_sphere.data[idx]
      tmax = stc_sphere.times[np.argmax(max_stc)]
      assert 0.08 < tmax < 0.15, tmax
      min_, max_ = 1.0, 4.5
      if weight_norm is None:
          min_ *= 2e-7
          max_ *= 2e-7
      assert min_ < np.max(max_stc) < max_, (
          min_,
          np.max(max_stc),
          max_,
      )
  
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 5 for calling a global function with example usage: test_make_lcmv_sphere(pick_ori, weight_norm) without return types