code: def test_orientation_prior(
      bias_params_free, method, looses, vmin, vmax, nmin, nmax
  ):
      """Test that orientation priors are handled properly."""
      evoked, fwd, noise_cov, _, _ = bias_params_free
      stcs = list()
      vec_stc = None
      for loose in looses:
          inv = make_inverse_operator(
              evoked.info, fwd, noise_cov, loose=loose
          )
          if looses[0] == 0.0:
              pick_ori = None if loose == 0 else "normal"
          else:
              pick_ori = "vector"
          stcs.append(
              apply_inverse(
                  evoked, inv, method=method, pick_ori=pick_ori
              )
          )
          if loose in (1.0, 0.2):
              assert vec_stc is None
              vec_stc = apply_inverse(
                  evoked, inv, method=method, pick_ori="vector"
              )
      assert vec_stc is not None
      rot = _normal_orth(
          np.concatenate([_get_src_nn(s) for s in inv["src"]])
      )
      vec_stc_surf = np.matmul(rot, vec_stc.data)
      if 0.0 in looses:
          vec_stc_normal, _ = vec_stc.project("normal", inv["src"])
          assert_allclose(stcs[1].data, vec_stc_normal.data)
          del vec_stc
          assert_allclose(vec_stc_normal.data, vec_stc_surf[:, 2])
          assert_allclose(vec_stc_normal.data, stcs[1].data)
      # Ensure that our relative strengths are reasonable
      # (normal should be much larger than tangential)
      normal = np.linalg.norm(vec_stc_surf[:, 2].ravel())
      for ii in range(2):
          tangential = np.linalg.norm(vec_stc_surf[:, ii].ravel())
          ratio = normal / tangential
          assert nmin < ratio < nmax
      assert stcs[0].data.shape == stcs[1].data.shape
      R2 = 1.0 - (
          np.linalg.norm(stcs[0].data.ravel() - stcs[1].data.ravel())
          / np.linalg.norm(stcs[0].data.ravel())
      )
      assert vmin < R2 < vmax
  
imports: import copy
  import re
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less, assert_equal
  from scipy import sparse
  import mne
  from mne import Covariance, EvokedArray, SourceEstimate, combine_evoked, compute_raw_covariance, convert_forward_solution, make_ad_hoc_cov, make_forward_solution, make_sphere_model, pick_channels_forward, pick_types, pick_types_forward, read_cov, read_evokeds, read_forward_solution
  from mne.datasets import testing
  from mne.epochs import Epochs, EpochsArray, make_fixed_length_epochs
  from mne.event import read_events
  from mne.forward import apply_forward, is_fixed_orient, restrict_forward_to_stc
  from mne.io import read_info, read_raw_fif
  from mne.label import label_sign_flip, read_label
  from mne.minimum_norm import INVERSE_METHODS, apply_inverse, apply_inverse_cov, apply_inverse_epochs, apply_inverse_raw, apply_inverse_tfr_epochs, compute_rank_inverse, make_inverse_operator, prepare_inverse_operator, read_inverse_operator, write_inverse_operator
  from mne.source_estimate import VolSourceEstimate, read_source_estimate
  from mne.source_space._source_space import _get_src_nn
  from mne.surface import _normal_orth
  from mne.time_frequency import EpochsTFR
  from mne.utils import _record_warnings, catch_logging
label_desc: Use image node_id 15 for calling a global function with example usage: test_orientation_prior(bias_params_free, method, looses, vmin, vmax, nmin, nmax) without return types