code: def _generate_tf_data():
      n, p, t = 30, 40, 64
      rng = np.random.RandomState(0)
      G = rng.randn(n, p)
      G /= np.std(G, axis=0)[None, :]
      X = np.zeros((p, t))
      active_set = [0, 4]
      times = np.linspace(0, 2 * np.pi, t)
      X[0] = np.sin(times)
      X[4] = -2 * np.sin(4 * times)
      X[4, times <= np.pi / 2] = 0
      X[4, times >= np.pi] = 0
      M = np.dot(G, X)
      M += 1 * rng.randn(*M.shape)
      return M, G, 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 1 for calling a global function with example usage: _generate_tf_data() and returns: M,  G,  active_set