code: def test_searchlight_group_cross_validation_with_extra_group_variable(
      rng,
      affine_eye,
  ):
      frames = 30
      data_img, cond, mask_img = _make_searchlight_test_data(frames)
      cv, n_jobs = define_cross_validation()
  
      groups = rng.permutation(
          np.arange(frames, dtype=int) > (frames // 2)
      )
  
      sl = searchlight.SearchLight(
          mask_img,
          process_mask_img=mask_img,
          radius=1,
          n_jobs=n_jobs,
          scoring="accuracy",
          cv=cv,
      )
      sl.fit(data_img, cond, groups)
  
      assert np.where(sl.scores_ == 1)[0].size == 7
      assert sl.scores_[2, 2, 2] == 1.0
  
      # Check whether searchlight works on list of 3D images
      data = rng.random((5, 5, 5))
      data_img = Nifti1Image(data, affine=affine_eye)
      imgs = [data_img] * 12
  
      # labels
      y = [0, 1] * 6
  
      # run searchlight on list of 3D images
      sl = searchlight.SearchLight(mask_img)
      sl.fit(imgs, y)
  
file_path: nilearn/nilearn/decoding/tests/test_searchlight.py
imports: import numpy
  from nibabel import Nifti1Image
  from sklearn.model_selection import KFold
  from nilearn.conftest import _rng
  from nilearn.decoding import searchlight
label_desc: Use image node_id 9 for calling a global function with example usage: test_searchlight_group_cross_validation_with_extra_group_variable(rng, affine_eye) without return types