code: def test_split_gof_basic(mod):
      """Test splitting the goodness of fit."""
      # first a trivial case
      gain = np.array([[0.0, 1.0, 1.0], [1.0, 1.0, 0.0]]).T
      M = np.ones((3, 1))
      X = np.ones((2, 1))
      M_est = gain @ X
      assert_allclose(
          M_est, np.array([[1.0, 2.0, 1.0]]).T
      )  # a reasonable estimate
      if mod == "mult":
          gain *= [1.0, -0.5]
          X[1] *= -2
      elif mod == "augment":
          gain = np.concatenate((gain, np.zeros((3, 1))), axis=1)
          X = np.concatenate((X, [[1.0]]))
      elif mod == "sign":
          gain[1] *= -1
          M[1] *= -1
          M_est[1] *= -1
      elif mod in ("zero", "less"):
          gain = np.array([[1, 1.0, 1.0], [1.0, 1.0, 1.0]]).T
          if mod == "zero":
              X[:, 0] = [1.0, 0.0]
          else:
              X[:, 0] = [1.0, 0.5]
          M_est = gain @ X
      else:
          assert mod is None
      res = M - M_est
      gof = 100 * (1.0 - (res * res).sum() / (M * M).sum())
      gof_split = _split_gof(M, X, gain)
      assert_allclose(gof_split.sum(), gof)
      want = gof_split[[0, 0]]
      if mod == "augment":
          want = np.concatenate((want, [[0]]))
      if mod in ("mult", "less"):
          assert_array_less(gof_split[1], gof_split[0])
      elif mod == "zero":
          assert_allclose(gof_split[0], gof_split.sum(0))
          assert_allclose(gof_split[1], 0.0, atol=1e-6)
      else:
          assert_allclose(gof_split, want, atol=1e-12)
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less
  import mne
  from mne import convert_forward_solution, read_cov, read_evokeds, read_forward_solution
  from mne.datasets import testing
  from mne.dipole import Dipole
  from mne.inverse_sparse import mixed_norm, tf_mixed_norm
  from mne.inverse_sparse.mxne_inverse import _compute_mxne_sure, _split_gof, make_stc_from_dipoles
  from mne.inverse_sparse.mxne_optim import norm_l2inf
  from mne.label import read_label
  from mne.minimum_norm import apply_inverse, make_inverse_operator
  from mne.minimum_norm.tests.test_inverse import assert_stc_res, assert_var_exp_log
  from mne.simulation import simulate_evoked, simulate_sparse_stc
  from mne.source_estimate import VolSourceEstimate
  from mne.utils import _record_warnings, assert_stcs_equal, catch_logging
label_desc: Use image node_id 4 for calling a global function with example usage: test_split_gof_basic(mod) without return types