code: def test_make_forward_solution_sphere(tmp_path, fname_src_small):
      """Test making a forward solution with a sphere model."""
      out_name = tmp_path / "tmp-fwd.fif"
      run_subprocess(
          [
              "mne_forward_solution",
              "--meg",
              "--eeg",
              "--meas",
              fname_raw,
              "--src",
              fname_src_small,
              "--mri",
              fname_trans,
              "--fwd",
              out_name,
          ]
      )
      fwd = read_forward_solution(out_name)
      sphere = make_sphere_model(verbose=True)
      src = read_source_spaces(fname_src_small)
      fwd_py = make_forward_solution(
          fname_raw,
          fname_trans,
          src,
          sphere,
          meg=True,
          eeg=True,
          verbose=True,
      )
      _compare_forwards(
          fwd,
          fwd_py,
          366,
          108,
          meg_rtol=5e-1,
          meg_atol=1e-6,
          eeg_rtol=5e-1,
          eeg_atol=5e-1,
      )
      # Since the above is pretty lax, let's check a different way
      for meg, eeg in zip([True, False], [False, True]):
          fwd_ = pick_types_forward(fwd, meg=meg, eeg=eeg)
          fwd_py_ = pick_types_forward(fwd, meg=meg, eeg=eeg)
          assert_allclose(
              np.corrcoef(
                  fwd_["sol"]["data"].ravel(),
                  fwd_py_["sol"]["data"].ravel(),
              )[0, 1],
              1.0,
              rtol=1e-3,
          )
      # Number of layers in the sphere model doesn't matter for MEG
      # (as long as no sources are omitted due to distance)
      assert len(sphere["layers"]) == 4
      fwd = make_forward_solution(
          fname_raw, fname_trans, src, sphere, meg=True, eeg=False
      )
      sphere_1 = make_sphere_model(head_radius=None)
      assert len(sphere_1["layers"]) == 0
      assert_array_equal(sphere["r0"], sphere_1["r0"])
      fwd_1 = make_forward_solution(
          fname_raw, fname_trans, src, sphere, meg=True, eeg=False
      )
      _compare_forwards(
          fwd, fwd_1, 306, 108, meg_rtol=1e-12, meg_atol=1e-12
      )
      # Homogeneous model
      sphere = make_sphere_model(head_radius=None)
      with pytest.raises(RuntimeError, match="zero shells.*EEG"):
          make_forward_solution(fname_raw, fname_trans, src, sphere)
  
imports: from itertools import product
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_array_less
  from mne import convert_forward_solution, create_info, get_volume_labels_from_aseg, make_forward_solution, make_sphere_model, pick_info, pick_types, pick_types_forward, read_cov, read_dipole, read_evokeds, read_forward_solution, read_source_spaces, setup_volume_source_space, write_forward_solution
  from mne._fiff.constants import FIFF
  from mne.bem import make_bem_solution, read_bem_surfaces
  from mne.channels import make_standard_montage
  from mne.datasets import testing
  from mne.dipole import Dipole, fit_dipole
  from mne.forward import Forward, _do_forward_solution, use_coil_def
  from mne.forward._compute_forward import _magnetic_dipole_field_vec
  from mne.forward._make_forward import _create_meg_coils, make_forward_dipole
  from mne.forward.tests.test_forward import assert_forward_allclose
  from mne.io import read_info, read_raw_bti, read_raw_fif, read_raw_kit
  from mne.simulation import simulate_evoked
  from mne.source_estimate import VolSourceEstimate
  from mne.source_space._source_space import _compare_source_spaces, setup_source_space, write_source_spaces
  from mne.surface import _get_ico_surface
  from mne.transforms import Transform
  from mne.utils import catch_logging, requires_mne, requires_mne_mark, requires_openmeeg_mark, run_subprocess
label_desc: Use image node_id 13 for calling a global function with example usage: test_make_forward_solution_sphere(tmp_path, fname_src_small) without return types