code: def fetch_atlas_difumo(
      dimension=64,
      resolution_mm=2,
      data_dir=None,
      resume=True,
      verbose=1,
      legacy_format=True,
  ):
      """Fetch DiFuMo brain atlas.
  
      Dictionaries of Functional Modes, or “DiFuMo”, can serve as
      :term:`probabilistic atlases<Probabilistic atlas>` to extract
      functional signals with different dimensionalities (64, 128,
      256, 512, and 1024).
      These modes are optimized to represent well raw :term:`BOLD` timeseries,
      over a with range of experimental conditions.
      See :footcite:t:`Dadi2020`.
  
      .. versionadded:: 0.7.1
  
      Notes
      -----
      Direct download links from OSF:
  
      - 64: https://osf.io/pqu9r/download
      - 128: https://osf.io/wjvd5/download
      - 256: https://osf.io/3vrct/download
      - 512: https://osf.io/9b76y/download
      - 1024: https://osf.io/34792/download
  
      Parameters
      ----------
      dimension : :obj:`int`, default=64
          Number of dimensions in the dictionary. Valid resolutions
          available are {64, 128, 256, 512, 1024}.
  
      resolution_mm : :obj:`int`, default=2mm
          The resolution in mm of the atlas to fetch. Valid options
          available are {2, 3}.
      %(data_dir)s
      %(resume)s
      %(verbose)s
      %(legacy_format)s
  
      Returns
      -------
      data : :class:`sklearn.utils.Bunch`
          Dictionary-like object, the interest attributes are :
  
          - 'maps': :obj:`str`, path to 4D nifti file containing regions
            definition. The shape of the image is
            ``(104, 123, 104, dimension)`` where ``dimension`` is the
            requested dimension of the atlas.
          - 'labels': :class:`numpy.recarray` containing the labels of
            the regions. The length of the label array corresponds to the
            number of dimensions requested. ``data.labels[i]`` is the label
            corresponding to volume ``i`` in the 'maps' image.
            If ``legacy_format`` is set to ``False``, this is a
            :class:`pandas.DataFrame`.
          - 'description': :obj:`str`, general description of the dataset.
  
      References
      ----------
      .. footbibliography::
  
      """
      dic = {
          64: "pqu9r",
          128: "wjvd5",
          256: "3vrct",
          512: "9b76y",
          1024: "34792",
      }
      valid_dimensions = [64, 128, 256, 512, 1024]
      valid_resolution_mm = [2, 3]
      if dimension not in valid_dimensions:
          raise ValueError(
              f"Requested dimension={dimension} is not available. "
              f"Valid options: {valid_dimensions}"
          )
      if resolution_mm not in valid_resolution_mm:
          raise ValueError(
              "Requested resolution_mm={resolution_mm} is not available. "
              "Valid options: {valid_resolution_mm}"
          )
  
      url = f"https://osf.io/{dic[dimension]}/download"
      opts = {"uncompress": True}
  
      csv_file = os.path.join("{0}", "labels_{0}_dictionary.csv")
      if resolution_mm != 3:
          nifti_file = os.path.join("{0}", "2mm", "maps.nii.gz")
      else:
          nifti_file = os.path.join("{0}", "3mm", "maps.nii.gz")
  
      files = [
          (csv_file.format(dimension), url, opts),
          (nifti_file.format(dimension), url, opts),
      ]
  
      dataset_name = "difumo_atlases"
  
      data_dir = get_dataset_dir(
          dataset_name=dataset_name, data_dir=data_dir, verbose=verbose
      )
  
      # Download the zip file, first
      files_ = fetch_files(data_dir, files, verbose=verbose)
      labels = pd.read_csv(files_[0])
      labels = labels.rename(
          columns={c: c.lower() for c in labels.columns}
      )
      if legacy_format:
          warnings.warn(_LEGACY_FORMAT_MSG, DeprecationWarning)
          labels = labels.to_records(index=False)
  
      # README
      readme_files = [
          (
              "README.md",
              "https://osf.io/4k9bf/download",
              {"move": "README.md"},
          )
      ]
      if not os.path.exists(os.path.join(data_dir, "README.md")):
          fetch_files(data_dir, readme_files, verbose=verbose)
  
      fdescr = get_dataset_descr(dataset_name)
  
      return Bunch(description=fdescr, maps=files_[1], labels=labels)
  
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 1 for calling a global function with example usage: fetch_atlas_difumo(dimension, resolution_mm, data_dir, resume, verbose, legacy_format) and returns: Bunch