code: def test_localization_bias_loose(
      bias_params_fixed, method, lower, upper, depth, loose, pick_ori
  ):
      """Test inverse localization bias for loose minimum-norm solvers."""
      if (
          pick_ori == "vector" and method == "eLORETA"
      ):  # works, but save cycles
          return
      evoked, fwd, noise_cov, _, want = bias_params_fixed
      fwd = convert_forward_solution(
          fwd, surf_ori=False, force_fixed=False
      )
      assert not is_fixed_orient(fwd)
      inv_loose = make_inverse_operator(
          evoked.info, fwd, noise_cov, loose=loose, depth=depth
      )
      loc, res = apply_inverse(
          evoked,
          inv_loose,
          lambda2,
          method,
          pick_ori=pick_ori,
          return_residual=True,
      )
      if pick_ori is not None:
          assert loc.data.ndim == 3
          loc, directions = loc.project("pca", src=fwd["src"])
          abs_cos_sim = np.abs(
              np.sum(directions * inv_loose["source_nn"][2::3], axis=1)
          )
          assert (
              np.percentile(abs_cos_sim, 10) > 0.9
          )  # most very aligned
          loc = abs(loc).data
      else:
          loc = loc.data
      assert (loc >= 0).all()
      # Compute the percentage of sources for which there is no loc bias:
      perc = (want == np.argmax(loc, axis=0)).mean() * 100
      assert lower <= perc <= upper, method
  
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 10 for calling a global function with example usage: test_localization_bias_loose(bias_params_fixed, method, lower, upper, depth, loose, pick_ori) without return types