code: def _prepare_downloaded_spm_auditory_data(subject_dir):
      """Uncompress downloaded spm_auditory dataset \
      and organize the data into appropriate directories.
  
      Parameters
      ----------
      subject_dir : :obj:`str`
          Path to subject's data directory.
  
      Returns
      -------
      _subject_data : skl.Bunch object
          Scikit-Learn Bunch object containing data of a single subject
          from the SPM Auditory dataset.
  
      """
      subject_data = {}
      spm_auditory_data_files = [
          f"fM00223/fM00223_{int(index):03}.img"
          for index in range(4, 100)
      ]
      spm_auditory_data_files.append("sM00223/sM00223_002.img")
  
      for file_name in spm_auditory_data_files:
          file_path = os.path.join(subject_dir, file_name)
          if os.path.exists(file_path):
              subject_data[file_name] = file_path
          else:
              print(f"{file_name} missing from filelist!")
              return None
  
      _subject_data = {
          "func": sorted(
              [
                  subject_data[x]
                  for x in subject_data
                  if re.match(
                      r"^fM00223_0\d\d\.img$", os.path.basename(x)
                  )
              ]
          )
      }
      # volumes for this dataset of shape (64, 64, 64, 1); let's fix this
      for x in _subject_data["func"]:
          vol = nib.load(x)
          if len(vol.shape) == 4:
              vol = nib.Nifti1Image(
                  get_data(vol)[:, :, :, 0], vol.affine
              )
              nib.save(vol, x)
  
      _subject_data["anat"] = [
          subject_data[x]
          for x in subject_data
          if re.match(r"^sM00223_002\.img$", os.path.basename(x))
      ][0]
  
      # ... same thing for anat
      vol = nib.load(_subject_data["anat"])
      if len(vol.shape) == 4:
          vol = nib.Nifti1Image(get_data(vol)[:, :, :, 0], vol.affine)
          nib.save(vol, _subject_data["anat"])
  
      return Bunch(**_subject_data)
  
imports: import fnmatch
  import glob
  import json
  import numbers
  import os
  import re
  import warnings
  from io import BytesIO
  from pathlib import Path
  import nibabel
  import nibabel
  import numpy
  import pandas
  from scipy.io import loadmat
  from sklearn.utils import Bunch
  from nilearn.image import get_data
  from .._utils import check_niimg, fill_doc
  from .._utils.numpy_conversions import csv_to_array
  from ._utils import fetch_files, fetch_single_file, filter_columns, get_dataset_descr, get_dataset_dir, read_md5_sum_file, tree, uncompress_file
label_desc: Use image node_id 31 for calling a global function with example usage: _prepare_downloaded_spm_auditory_data(subject_dir) and returns: Bunch, None