code: def test_priors():
      """Test prior computations."""
      # Depth prior
      fwd = read_forward_solution(fname_meeg)
      assert not is_fixed_orient(fwd)
      n_sources = fwd["nsource"]
      info = read_info(fname_evoked)
      depth_prior = compute_depth_prior(fwd, info, exp=0.8)
      assert depth_prior.shape == (3 * n_sources,)
      depth_prior = compute_depth_prior(fwd, info, exp=0.0)
      assert_array_equal(depth_prior, 1.0)
      with pytest.raises(ValueError, match='must be "whiten"'):
          compute_depth_prior(fwd, info, limit_depth_chs="foo")
      with pytest.raises(
          ValueError, match="noise_cov must be a Covariance"
      ):
          compute_depth_prior(fwd, info, limit_depth_chs="whiten")
      fwd_fixed = convert_forward_solution(fwd, force_fixed=True)
      depth_prior = compute_depth_prior(fwd_fixed, info=info)
      assert depth_prior.shape == (n_sources,)
      # Orientation prior
      orient_prior = compute_orient_prior(fwd, 1.0)
      assert_array_equal(orient_prior, 1.0)
      orient_prior = compute_orient_prior(fwd_fixed, 0.0)
      assert_array_equal(orient_prior, 1.0)
      with pytest.raises(
          ValueError, match="oriented in surface coordinates"
      ):
          compute_orient_prior(fwd, 0.5)
      fwd_surf_ori = convert_forward_solution(fwd, surf_ori=True)
      orient_prior = compute_orient_prior(fwd_surf_ori, 0.5)
      assert all(np.isin(orient_prior, (0.5, 1.0)))
      with pytest.raises(ValueError, match="between 0 and 1"):
          compute_orient_prior(fwd_surf_ori, -0.5)
      with pytest.raises(ValueError, match="with fixed orientation"):
          compute_orient_prior(fwd_fixed, 0.5)
  
imports: import gc
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import SourceEstimate, VectorSourceEstimate, apply_forward, apply_forward_raw, average_forward_solutions, convert_forward_solution, pick_types_forward, read_evokeds, read_forward_solution, write_forward_solution
  from mne._fiff.pick import pick_channels_forward
  from mne.channels import equalize_channels
  from mne.datasets import testing
  from mne.forward import Forward, compute_depth_prior, compute_orient_prior, is_fixed_orient, restrict_forward_to_label, restrict_forward_to_stc
  from mne.io import read_info
  from mne.label import read_label
  from mne.utils import requires_mne, run_subprocess
label_desc: Use image node_id 9 for calling a global function with example usage: test_priors() without return types