code: def fetch_surf_nki_enhanced(
      n_subjects=10, data_dir=None, url=None, resume=True, verbose=1
  ):
      """Download and load the NKI enhanced :term:`resting-state` dataset, \
      preprocessed and projected to the fsaverage5 space surface.
  
      See :footcite:t:`Nooner2012`.
  
      Direct download link :footcite:t:`NKIdataset`.
  
      .. versionadded:: 0.3
  
      Parameters
      ----------
      n_subjects : :obj:`int`, default=10
          The number of subjects to load from maximum of 102 subjects.
          By default, 10 subjects will be loaded. If None is given,
          all 102 subjects will be loaded.
      %(data_dir)s
      %(url)s
      %(resume)s
      %(verbose)s
  
      Returns
      -------
      data : sklearn.datasets.base.Bunch
          Dictionary-like object, the interest attributes are :
  
          - 'func_left': Paths to Gifti files containing resting state
                          time series left hemisphere
          - 'func_right': Paths to Gifti files containing resting state
                           time series right hemisphere
          - 'phenotypic': array containing tuple with subject ID, age,
                           dominant hand and sex for each subject.
          - 'description': data description of the release and references.
  
      References
      ----------
      .. footbibliography::
  
      """
      if url is None:
          url = "https://www.nitrc.org/frs/download.php/"
  
      # Preliminary checks and declarations
      dataset_name = "nki_enhanced_surface"
      data_dir = get_dataset_dir(
          dataset_name, data_dir=data_dir, verbose=verbose
      )
  
      nitrc_ids = range(8260, 8464)
      ids = nki_ids()
      max_subjects = len(ids)
      if n_subjects is None:
          n_subjects = max_subjects
      if n_subjects > max_subjects:
          warnings.warn(
              f"Warning: there are only {max_subjects} subjects"
          )
          n_subjects = max_subjects
      ids = ids[:n_subjects]
  
      # Dataset description
      fdescr = get_dataset_descr(dataset_name)
  
      # First, get the metadata
      phenotypic_file = "NKI_enhanced_surface_phenotypics.csv"
      phenotypic = (
          phenotypic_file,
          url + "8470/pheno_nki_nilearn.csv",
          {"move": phenotypic_file},
      )
  
      phenotypic = fetch_files(
          data_dir, [phenotypic], resume=resume, verbose=verbose
      )[0]
  
      # Load the csv file
      phenotypic = np.genfromtxt(
          phenotypic,
          skip_header=True,
          names=["Subject", "Age", "Dominant Hand", "Sex"],
          delimiter=",",
          dtype=["U9", "<f8", "U1", "U1"],
          encoding=None,
      )
  
      # Keep phenotypic information for selected subjects
      int_ids = np.asarray(ids)
      phenotypic = phenotypic[
          [np.where(phenotypic["Subject"] == i)[0][0] for i in int_ids]
      ]
  
      # Download subjects' datasets
      func_right = []
      func_left = []
      for i in range(len(ids)):
          archive = url + "%i/%s_%s_preprocessed_fsaverage5_fwhm6.gii"
          func = os.path.join("%s", "%s_%s_preprocessed_fwhm6.gii")
          rh = fetch_files(
              data_dir,
              [
                  (
                      func % (ids[i], ids[i], "right"),
                      archive % (nitrc_ids[2 * i + 1], ids[i], "rh"),
                      {"move": func % (ids[i], ids[i], "right")},
                  )
              ],
              resume=resume,
              verbose=verbose,
          )
          lh = fetch_files(
              data_dir,
              [
                  (
                      func % (ids[i], ids[i], "left"),
                      archive % (nitrc_ids[2 * i], ids[i], "lh"),
                      {"move": func % (ids[i], ids[i], "left")},
                  )
              ],
              resume=resume,
              verbose=verbose,
          )
  
          func_right.append(rh[0])
          func_left.append(lh[0])
  
      return Bunch(
          func_left=func_left,
          func_right=func_right,
          phenotypic=phenotypic,
          description=fdescr,
      )
  
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 14 for calling a global function with example usage: fetch_surf_nki_enhanced(n_subjects, data_dir, url, resume, verbose) and returns: Bunch