code: def test_mxne_inverse_sure_synthetic(
      n_sensors, n_dipoles, n_times, nnz, corr, n_orient, snr=4
  ):
      """Tests SURE criterion for automatic alpha selection on synthetic data."""
      rng = np.random.RandomState(0)
      sigma = np.sqrt(1 - corr**2)
      U = rng.randn(n_sensors)
      # generate gain matrix
      G = np.empty([n_sensors, n_dipoles], order="F")
      G[:, :n_orient] = np.expand_dims(U, axis=-1)
      n_dip_per_pos = n_dipoles // n_orient
      for j in range(1, n_dip_per_pos):
          U *= corr
          U += sigma * rng.randn(n_sensors)
          G[:, j * n_orient : (j + 1) * n_orient] = np.expand_dims(
              U, axis=-1
          )
      # generate coefficient matrix
      support = rng.choice(n_dip_per_pos, nnz, replace=False)
      X = np.zeros((n_dipoles, n_times))
      for k in support:
          X[k * n_orient : (k + 1) * n_orient, :] = rng.normal(
              size=(n_orient, n_times)
          )
      # generate measurement matrix
      M = G @ X
      noise = rng.randn(n_sensors, n_times)
      sigma = 1 / np.linalg.norm(noise) * np.linalg.norm(M) / snr
      M += sigma * noise
      # inverse modeling with sure
      alpha_max = norm_l2inf(np.dot(G.T, M), n_orient, copy=False)
      alpha_grid = np.geomspace(alpha_max, alpha_max / 10, num=15)
      _, active_set, _ = _compute_mxne_sure(
          M,
          G,
          alpha_grid,
          sigma=sigma,
          n_mxne_iter=5,
          maxit=3000,
          tol=1e-4,
          n_orient=n_orient,
          active_set_size=10,
          debias=True,
          solver="auto",
          dgap_freq=10,
          random_state=0,
          verbose=False,
      )
      assert np.count_nonzero(active_set, axis=-1) == n_orient * nnz
  
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 6 for calling a global function with example usage: test_mxne_inverse_sure_synthetic(n_sensors, n_dipoles, n_times, nnz, corr, n_orient, snr) without return types