code: def _generate_confounds_file_candidates(nii_file):
      """Generate confounds file candidates.
  
      Build a list of potential confounds filenames using all combinations of
      the entities in the image file.
  
      Parameters
      ----------
      nii_file : str
          Path to the functional image file.
  
      Returns
      -------
      filenames : list of str
          List of potential confounds filenames.
      """
      entities = parse_bids_filename(nii_file)
      file_fields = entities["file_fields"]
      entities = {k: v for k, v in entities.items() if k in file_fields}
      entities["desc"] = "confounds"
      if "desc" not in file_fields:
          file_fields.append("desc")
  
      all_subsets = []
      for n_entities in range(1, len(file_fields) + 1):
          all_subsets.append(
              list(itertools.combinations(file_fields, n_entities))
          )
  
      # Flatten the list of lists
      all_subsets = [
          list(item) for sublist in all_subsets for item in sublist
      ]
      # https://stackoverflow.com/a/3724558/2589328
      unique_subsets = [
          list(x) for x in {tuple(x) for x in all_subsets}
      ]
  
      # Require "desc"
      unique_subsets = [
          subset for subset in unique_subsets if "desc" in subset
      ]
  
      filenames = [
          "_".join(["-".join([k, entities[k]]) for k in lst])
          for lst in unique_subsets
      ]
      return filenames
  
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 5 for calling a global function with example usage: _generate_confounds_file_candidates(nii_file) and returns: filenames