code: def _load_single_confounds_file(
      confounds_file,
      strategy,
      demean=True,
      confounds_json_file=None,
      **kwargs,
  ):
      """Load and extract specified confounds from the confounds file.
  
      Parameters
      ----------
      confounds_file : :obj:`str`
          Path to confounds file.
  
      strategy : :obj:`tuple` or :obj:`list` of :obj:`str`.
          See :func:`nilearn.interfaces.fmriprep.load_confounds` for details.
  
      demean : :obj:`bool`, default=True
          See :func:`nilearn.interfaces.fmriprep.load_confounds` for details.
  
      confounds_json_file : :obj:`str`, default=None
          Path to confounds json file.
  
      kwargs : :obj:`dict`
          Extra relevant parameters for the given `strategy`.
          See :func:`nilearn.interfaces.fmriprep.load_confounds` for details.
  
      Returns
      -------
      confounds : :class:`pandas.DataFrame`
          See :func:`nilearn.interfaces.fmriprep.load_confounds` for details.
  
      Raises
      ------
      ValueError
          If any of the confounds specified in the strategy are not found in the
          confounds file or confounds json file.
      """
      flag_acompcor = ("compcor" in strategy) and (
          "anat" in kwargs.get("compcor")
      )
      # Convert tsv file to pandas dataframe
      confounds_all = load_confounds_file_as_dataframe(confounds_file)
  
      if confounds_json_file is None:
          confounds_json_file = get_json(confounds_file)
  
      # Read the associated json file
      meta_json = load_confounds_json(
          confounds_json_file, flag_acompcor=flag_acompcor
      )
  
      missing = {"confounds": [], "keywords": []}
      # always check non steady state volumes are loaded
      confounds_select, missing = _load_noise_component(
          confounds_all,
          "non_steady_state",
          missing,
          meta_json=meta_json,
          **kwargs,
      )
      for component in strategy:
          loaded_confounds, missing = _load_noise_component(
              confounds_all,
              component,
              missing,
              meta_json=meta_json,
              **kwargs,
          )
          confounds_select = pd.concat(
              [confounds_select, loaded_confounds], axis=1
          )
  
      _check_error(missing)  # raise any missing
      return prepare_output(confounds_select, demean)
  
file_path: nilearn/nilearn/interfaces/fmriprep/load_confounds.py
imports: import warnings
  import pandas
  from .None import load_confounds_components
  from .load_confounds_utils import MissingConfound, get_confounds_file, get_json, load_confounds_file_as_dataframe, load_confounds_json, prepare_output, sanitize_confounds
label_desc: Use image node_id 5 for calling a global function with example usage: _load_single_confounds_file(confounds_file, strategy, demean, confounds_json_file) and returns: prepare_output