code: def test_fetch_atlas_craddock_2012(tmp_path, request_mocker):
      local_archive = (
          Path(__file__).parent
          / "data"
          / "craddock_2011_parcellations.tar.gz"
      )
      request_mocker.url_mapping["*craddock*"] = local_archive
      bunch = atlas.fetch_atlas_craddock_2012(
          data_dir=tmp_path, verbose=0, homogeneity="spatial"
      )
      bunch_rand = atlas.fetch_atlas_craddock_2012(
          data_dir=tmp_path, verbose=0, homogeneity="random"
      )
      bunch_no_mean = atlas.fetch_atlas_craddock_2012(
          data_dir=tmp_path,
          verbose=0,
          grp_mean=False,
          homogeneity="spatial",
      )
  
      assert request_mocker.url_count == 1
      assert bunch["maps"] == str(
          tmp_path / "craddock_2012" / "scorr05_mean_all.nii.gz"
      )
      assert bunch_rand["maps"] == str(
          tmp_path / "craddock_2012" / "random_all.nii.gz"
      )
      assert bunch_no_mean["maps"] == str(
          tmp_path / "craddock_2012" / "scorr05_2level_all.nii.gz"
      )
      assert bunch.description != ""
  
      # Old code
      bunch = atlas.fetch_atlas_craddock_2012(
          data_dir=tmp_path, verbose=0
      )
  
      keys = (
          "scorr_mean",
          "tcorr_mean",
          "scorr_2level",
          "tcorr_2level",
          "random",
      )
      filenames = [
          "scorr05_mean_all.nii.gz",
          "tcorr05_mean_all.nii.gz",
          "scorr05_2level_all.nii.gz",
          "tcorr05_2level_all.nii.gz",
          "random_all.nii.gz",
      ]
  
      assert request_mocker.url_count == 1
      for key, fn in zip(keys, filenames):
          assert bunch[key] == str(tmp_path / "craddock_2012" / fn)
      assert bunch.description != ""
  
imports: import itertools
  import os
  import re
  from pathlib import Path
  import nibabel
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_array_equal
  from nilearn._utils import data_gen
  from nilearn._utils.testing import serialize_niimg
  from nilearn.conftest import _rng
  from nilearn.datasets import atlas
  from nilearn.datasets._utils import fetch_files
  from nilearn.datasets.tests._testing import dict_to_archive
  from nilearn.image import get_data
label_desc: Use image node_id 9 for calling a global function with example usage: test_fetch_atlas_craddock_2012(tmp_path, request_mocker) without return types