code: def fetch_atlas_smith_2009(
      data_dir=None,
      url=None,
      resume=True,
      verbose=1,
      mirror="origin",
      dimension=None,
      resting=True,
  ):
      """Download and load the Smith :term:`ICA` and BrainMap \
      :term:`Probabilistic atlas` (2009).
  
      See :footcite:t:`Smith2009b` and :footcite:t:`Laird2011`.
  
      Parameters
      ----------
      %(data_dir)s
      %(url)s
      %(resume)s
      %(verbose)s
      mirror : :obj:`str`, default='origin'
          By default, the dataset is downloaded from the original website of the
          atlas. Specifying "nitrc" will force download from a mirror, with
          potentially higher bandwidth.
      dimension: :obj:`int`, optional
          Number of dimensions in the dictionary. Valid resolutions
          available are {10, 20, 70}.
      resting : :obj:`bool`, default=True
          Either to fetch the resting-:term:`fMRI` or BrainMap components
  
      Returns
      -------
      data : :class:`sklearn.utils.Bunch`
          Dictionary-like object, contains:
  
              - 'rsn20': :obj:`str`, path to nifti file containing the
                20-dimensional :term:`ICA`, resting-:term:`fMRI` components.
                The shape of the image is ``(91, 109, 91, 20)``.
              - 'rsn10': :obj:`str`, path to nifti file containing the
                10 well-matched maps from the 20 maps obtained as for 'rsn20',
                as shown in :footcite:t:`Smith2009b`. The shape of the
                image is ``(91, 109, 91, 10)``.
              - 'bm20': :obj:`str`, path to nifti file containing the
                20-dimensional :term:`ICA`, BrainMap components.
                The shape of the image is ``(91, 109, 91, 20)``.
              - 'bm10': :obj:`str`, path to nifti file containing the
                10 well-matched maps from the 20 maps obtained as for 'bm20',
                as shown in :footcite:t:`Smith2009b`. The shape of the
                image is ``(91, 109, 91, 10)``.
              - 'rsn70': :obj:`str`, path to nifti file containing the
                70-dimensional :term:`ICA`, resting-:term:`fMRI` components.
                The shape of the image is ``(91, 109, 91, 70)``.
              - 'bm70': :obj:`str`, path to nifti file containing the
                70-dimensional :term:`ICA`, BrainMap components.
                The shape of the image is ``(91, 109, 91, 70)``.
              - 'description': :obj:`str`, description of the atlas.
  
      Warns
      -----
      DeprecationWarning
          If a dimension 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 dimension and resting value.
  
      References
      ----------
      .. footbibliography::
  
      Notes
      -----
      For more information about this dataset's structure:
      https://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/
  
      """
      if url is None:
          if mirror == "origin":
              url = "https://www.fmrib.ox.ac.uk/datasets/brainmap+rsns/"
          elif mirror == "nitrc":
              url = [
                  "https://www.nitrc.org/frs/download.php/7730/",
                  "https://www.nitrc.org/frs/download.php/7729/",
                  "https://www.nitrc.org/frs/download.php/7731/",
                  "https://www.nitrc.org/frs/download.php/7726/",
                  "https://www.nitrc.org/frs/download.php/7728/",
                  "https://www.nitrc.org/frs/download.php/7727/",
              ]
          else:
              raise ValueError(
                  f'Unknown mirror "{str(mirror)}". '
                  'Mirror must be "origin" or "nitrc"'
              )
  
      files = {
          "rsn20": "rsn20.nii.gz",
          "rsn10": "PNAS_Smith09_rsn10.nii.gz",
          "rsn70": "rsn70.nii.gz",
          "bm20": "bm20.nii.gz",
          "bm10": "PNAS_Smith09_bm10.nii.gz",
          "bm70": "bm70.nii.gz",
      }
  
      if isinstance(url, str):
          url = [url] * len(files)
  
      dataset_name = "smith_2009"
      data_dir = get_dataset_dir(
          dataset_name, data_dir=data_dir, verbose=verbose
      )
  
      fdescr = get_dataset_descr(dataset_name)
  
      if dimension:
          key = f"{'rsn' if resting else 'bm'}{dimension}"
          key_index = list(files).index(key)
  
          file = [(files[key], url[key_index] + files[key], {})]
          data = fetch_files(
              data_dir, file, resume=resume, verbose=verbose
          )
          params = Bunch(maps=data[0], description=fdescr)
      else:
          keys = list(files.keys())
          files = [(f, u + f, {}) for f, u in zip(files.values(), url)]
          files_ = fetch_files(
              data_dir, files, resume=resume, verbose=verbose
          )
          params = dict(zip(keys, files_))
          params["description"] = fdescr
          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 dimension and resting.",
          )
  
      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 12 for calling a global function with example usage: fetch_atlas_smith_2009(data_dir, url, resume, verbose, mirror, dimension, resting) and returns: Bunch