code: def test_group_sparse_covariance(rng):
      # run in debug mode. Should not fail
      # without debug mode: cost must decrease.
  
      signals, _, _ = generate_group_sparse_gaussian_graphs(
          density=0.1,
          n_subjects=5,
          n_features=10,
          min_n_samples=100,
          max_n_samples=151,
          random_state=rng,
      )
  
      alpha = 0.1
  
      # These executions must hit the tolerance limit
      _, omega = group_sparse_covariance(
          signals, alpha, max_iter=20, tol=1e-2, debug=True, verbose=0
      )
      _, omega2 = group_sparse_covariance(
          signals, alpha, max_iter=20, tol=1e-2, debug=True, verbose=0
      )
  
      np.testing.assert_almost_equal(omega, omega2, decimal=4)
  
file_path: nilearn/nilearn/connectome/tests/test_group_sparse_cov.py
imports: import numpy
  import pytest
  from nilearn._utils.data_gen import generate_group_sparse_gaussian_graphs
  from nilearn.connectome import GroupSparseCovariance, GroupSparseCovarianceCV
  from nilearn.connectome.group_sparse_cov import group_sparse_covariance, group_sparse_scores
label_desc: Use image node_id 1 for calling a global function with example usage: test_group_sparse_covariance(rng) without return types