code: def test_group_sparse_covariance_check_consistency_between_classes(
      rng,
  ):
      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,
      )
  
      # Check consistency between classes
      gsc1 = GroupSparseCovarianceCV(
          alphas=4,
          tol=1e-1,
          max_iter=20,
          verbose=0,
          early_stopping=True,
      )
      gsc1.fit(signals)
  
      gsc2 = GroupSparseCovariance(
          alpha=gsc1.alpha_, tol=1e-1, max_iter=20, verbose=0
      )
      gsc2.fit(signals)
  
      np.testing.assert_almost_equal(
          gsc1.precisions_, gsc2.precisions_, 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 3 for calling a global function with example usage: test_group_sparse_covariance_check_consistency_between_classes(rng) without return types