code: def test_orientation_max_power(
      bias_params_fixed,
      bias_params_free,
      reg,
      weight_norm,
      use_cov,
      depth,
      lower,
      upper,
      lower_ori,
      upper_ori,
  ):
      """Test orientation selection for bias for max-power LCMV."""
      # we simulate data for the fixed orientation forward and beamform using
      # the free orientation forward, and check the orientation match at the end
      evoked, _, noise_cov, data_cov, want = bias_params_fixed
      fwd = bias_params_free[1]
      if not use_cov:
          evoked.pick(picks="grad")
          noise_cov = None
      filters = make_lcmv(
          evoked.info,
          fwd,
          data_cov,
          reg,
          noise_cov,
          pick_ori="max-power",
          weight_norm=weight_norm,
          depth=depth,
      )
      loc = apply_lcmv(evoked, filters).data
      ori = filters["max_power_ori"]
      assert ori.shape == (246, 3)
      loc = np.abs(loc)
      # Compute the percentage of sources for which there is no loc bias:
      max_idx = np.argmax(loc, axis=0)
      mask = want == max_idx  # ones that localized properly
      perc = mask.mean() * 100
      assert lower <= perc <= upper
      # Compute the dot products of our forward normals and
      assert fwd["coord_frame"] == FIFF.FIFFV_COORD_HEAD
      nn = np.concatenate(
          [s["nn"][v] for s, v in zip(fwd["src"], filters["vertices"])]
      )
      nn = nn[want]
      nn = apply_trans(
          invert_transform(fwd["mri_head_t"]), nn, move=False
      )
      assert_allclose(np.linalg.norm(nn, axis=1), 1, atol=1e-6)
      assert_allclose(np.linalg.norm(ori, axis=1), 1, atol=1e-12)
      dots = np.abs((nn[mask] * ori[mask]).sum(-1))
      assert_array_less(dots, 1)
      assert_array_less(0, dots)
      got = np.mean(dots)
      assert lower_ori < got < upper_ori
  
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 11 for calling a global function with example usage: test_orientation_max_power(bias_params_fixed, bias_params_free, reg, weight_norm, use_cov, depth, lower, upper, lower_ori, upper_ori) without return types