code: def fetch_atlas_craddock_2012(
      data_dir=None,
      url=None,
      resume=True,
      verbose=1,
      homogeneity=None,
      grp_mean=True,
  ):
      """Download and return file names \
         for the Craddock 2012 :term:`parcellation`.
  
      This function returns a :term:`probabilistic atlas<Probabilistic atlas>`.
      The provided images are in MNI152 space. All images are 4D with
      shapes equal to ``(47, 56, 46, 43)``.
  
      See :footcite:t:`CreativeCommons` for the licence.
  
      See :footcite:t:`Craddock2012` and :footcite:t:`nitrcClusterROI`
      for more information on this :term:`parcellation`.
  
      Parameters
      ----------
      %(data_dir)s
      %(url)s
      %(resume)s
      %(verbose)s
      homogeneity: :obj:`str`, optional
          The choice of the homogeneity ('spatial' or 'temporal' or 'random')
      grp_mean: :obj:`bool`, default=True
          The choice of the :term:`parcellation` (with group_mean or without)
          Default=True.
  
  
      Returns
      -------
      data : :class:`sklearn.utils.Bunch`
          Dictionary-like object, keys are:
  
              - 'scorr_mean': obj:`str`, path to nifti file containing the
                group-mean :term:`parcellation`
                when emphasizing spatial homogeneity.
              - 'tcorr_mean': obj:`str`, path to nifti file containing the
                group-mean parcellation when emphasizing temporal homogeneity.
              - 'scorr_2level': obj:`str`, path to nifti file containing the
                :term:`parcellation` obtained
                when emphasizing spatial homogeneity.
              - 'tcorr_2level': obj:`str`, path to nifti file containing the
                :term:`parcellation` obtained
                when emphasizing temporal homogeneity.
              - 'random': obj:`str`, path to nifti file containing the
                :term:`parcellation` obtained with random clustering.
              - 'description': :obj:`str`, general description of the dataset.
  
      Warns
      -----
      DeprecationWarning
          If an homogeneity input is provided, the current behavior
          (returning multiple maps) is deprecated.
          Starting in version 0.13, one map will be returned in a 'maps' dict key
          depending on the homogeneity and grp_mean value.
  
      References
      ----------
      .. footbibliography::
  
      """
      if url is None:
          url = (
              "https://cluster_roi.projects.nitrc.org"
              "/Parcellations/craddock_2011_parcellations.tar.gz"
          )
      opts = {"uncompress": True}
  
      dataset_name = "craddock_2012"
  
      keys = (
          "scorr_mean",
          "tcorr_mean",
          "scorr_2level",
          "tcorr_2level",
          "random",
      )
      filenames = [
          ("scorr05_mean_all.nii.gz", url, opts),
          ("tcorr05_mean_all.nii.gz", url, opts),
          ("scorr05_2level_all.nii.gz", url, opts),
          ("tcorr05_2level_all.nii.gz", url, opts),
          ("random_all.nii.gz", url, opts),
      ]
  
      data_dir = get_dataset_dir(
          dataset_name, data_dir=data_dir, verbose=verbose
      )
  
      sub_files = fetch_files(
          data_dir, filenames, resume=resume, verbose=verbose
      )
  
      fdescr = get_dataset_descr(dataset_name)
  
      if homogeneity:
          if homogeneity in ["spatial", "temporal"]:
              if grp_mean:
                  filename = [
                      (
                          homogeneity[0] + "corr05_mean_all.nii.gz",
                          url,
                          opts,
                      )
                  ]
              else:
                  filename = [
                      (
                          homogeneity[0] + "corr05_2level_all.nii.gz",
                          url,
                          opts,
                      )
                  ]
          else:
              filename = [("random_all.nii.gz", url, opts)]
          data = fetch_files(
              data_dir, filename, resume=resume, verbose=verbose
          )
          params = dict(maps=data[0], description=fdescr)
      else:
          params = dict(
              [("description", fdescr)] + list(zip(keys, sub_files))
          )
          warnings.warn(
              category=DeprecationWarning,
              message="In release 0.13, this fetcher will return a dictionary "
              "with one map accessed through a 'maps' key. Please use the new "
              "parameters homogeneity and grp_mean.",
          )
  
      return Bunch(**params)
  
imports: import json
  import os
  import re
  import shutil
  import warnings
  import xml.etree.ElementTree
  from pathlib import Path
  from tempfile import mkdtemp
  import nibabel
  import numpy
  import pandas
  from sklearn.utils import Bunch
  from .._utils import check_niimg, fill_doc
  from ..image import get_data, new_img_like, reorder_img
  from ._utils import fetch_files, get_dataset_descr, get_dataset_dir
label_desc: Use image node_id 2 for calling a global function with example usage: fetch_atlas_craddock_2012(data_dir, url, resume, verbose, homogeneity, grp_mean) and returns: Bunch