code: def test_tf_mxne():
      """Test convergence of TF-MxNE solver."""
      alpha_space = 10.0
      alpha_time = 5.0
  
      M, G, active_set = _generate_tf_data()
  
      with _record_warnings():  # CD
          (
              X_hat_tf,
              active_set_hat_tf,
              E,
              gap_tfmxne,
          ) = tf_mixed_norm_solver(
              M,
              G,
              alpha_space,
              alpha_time,
              maxit=200,
              tol=1e-8,
              verbose=True,
              n_orient=1,
              tstep=4,
              wsize=32,
              return_gap=True,
          )
      assert_array_less(gap_tfmxne, 1e-8)
      assert_array_equal(np.where(active_set_hat_tf)[0], active_set)
  
file_path: mne-python/mne/inverse_sparse/tests/test_mxne_optim.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less
  from mne.inverse_sparse.mxne_optim import _Phi, _PhiT, dgap_l21l1, iterative_mixed_norm_solver, iterative_tf_mixed_norm_solver, mixed_norm_solver, norm_epsilon, norm_epsilon_inf, tf_mixed_norm_solver
  from mne.time_frequency._stft import stft_norm2
  from mne.utils import _record_warnings, catch_logging
label_desc: Use image node_id 4 for calling a global function with example usage: test_tf_mxne() without return types