code: def test_orientation_max_power(
      bias_params_fixed,
      bias_params_free,
      weight_norm,
      lower,
      upper,
      lower_ori,
      upper_ori,
      real_filter,
  ):
      """Test orientation selection for bias for max-power DICS."""
      # 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
      noise_csd = _cov_as_csd(noise_cov, evoked.info)
      data_csd = _cov_as_csd(data_cov, evoked.info)
      del data_cov, noise_cov
      fwd = bias_params_free[1]
      filters = make_dics(
          evoked.info,
          fwd,
          data_csd,
          0.05,
          noise_csd,
          pick_ori="max-power",
          weight_norm=weight_norm,
          depth=None,
          real_filter=real_filter,
      )
      loc = np.abs(apply_dics(evoked, filters).data)
      ori = filters["max_power_ori"][0]
      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 we get some hopefully reasonable agreement
      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: import copy
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_array_less
  import mne
  from mne import pick_types
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import pick_info
  from mne.beamformer import Beamformer, apply_dics, apply_dics_csd, apply_dics_epochs, apply_dics_tfr_epochs, make_dics, read_beamformer
  from mne.beamformer._compute_beamformer import _prepare_beamformer_input
  from mne.beamformer._dics import _prepare_noise_csd
  from mne.beamformer.tests.test_lcmv import _assert_weight_norm
  from mne.datasets import testing
  from mne.io import read_info
  from mne.proj import compute_proj_evoked, make_projector
  from mne.surface import _compute_nearest
  from mne.time_frequency import CrossSpectralDensity, EpochsTFR, csd_morlet, csd_tfr
  from mne.time_frequency.csd import _sym_mat_to_vector
  from mne.transforms import apply_trans, invert_transform
  from mne.utils import catch_logging, object_diff
label_desc: Use image node_id 15 for calling a global function with example usage: test_orientation_max_power(bias_params_fixed, bias_params_free, weight_norm, lower, upper, lower_ori, upper_ori, real_filter) without return types