code: def sanitize_confounds(img_files):
      """Make sure the inputs are in the correct format.
  
      Parameters
      ----------
      img_files : str or list of str
          Path to the functional image file(s).
  
      Returns
      -------
      img_files : list of str
          List of functional image file(s).
      flag_single : bool
          True if the input is a single file, False if it is a list of
          files.
      """
      # we want to support loading a single set of confounds, instead of a list
      # so we hack it
      if len(img_files) == 1:
          return img_files, True
      # gifti has to be passed as pair
      if isinstance(img_files, list) and len(img_files) == 2:
          flag_single = flag_single_gifti(img_files)
      else:  # single file
          flag_single = isinstance(img_files, str)
      if flag_single:
          img_files = [img_files]
      return img_files, flag_single
  
imports: import itertools
  import json
  import os
  import re
  import numpy
  import pandas
  from sklearn.preprocessing import scale
  from nilearn._utils.fmriprep_confounds import flag_single_gifti, is_camel_case
  from nilearn.interfaces.bids import parse_bids_filename
  from .load_confounds_scrub import extract_outlier_regressors
label_desc: Use image node_id 3 for calling a global function with example usage: sanitize_confounds(img_files) and returns: img_files,  flag_single, img_files,  True