code: def modifiedFiles(pathFilter=None):
      """
      If inside a CI-env (ie. TARGET_BRANCH and COMMIT_HASH are defined, and
      current branch is "current-pr-branch"), then lists out all files modified
      between these 2 branches. Locally, TARGET_BRANCH will try to be determined
      from the current repo version and finding a corresponding branch named
      'branch-{major}.{minor}'. If this fails, this function will list out all
      the uncommitted files in the current branch.
  
      Such utility function is helpful while putting checker scripts as part of
      cmake, as well as CI process. This way, during development, only the files
      touched (but not yet committed) by devs can be checked. But, during the CI
      process ALL files modified by the dev, as submiited in the PR, will be
      checked. This happens, all the while using the same script.
      """
      targetBranch = os.environ.get("TARGET_BRANCH")
      commitHash = os.environ.get("COMMIT_HASH")
      currentBranch = branch()
      print(
          f"   [DEBUG] TARGET_BRANCH={targetBranch}, COMMIT_HASH={commitHash}, "
          f"currentBranch={currentBranch}"
      )
  
      if (
          targetBranch
          and commitHash
          and (currentBranch == "current-pr-branch")
      ):
          print("   [DEBUG] Assuming a CI environment.")
          allFiles = changedFilesBetween(
              targetBranch, currentBranch, commitHash
          )
      else:
          print(
              "   [DEBUG] Did not detect CI environment. "
              "Determining TARGET_BRANCH locally."
          )
  
          common_commit = determine_merge_commit(currentBranch)
  
          if common_commit is not None:
              # Now get the diff. Use --staged to get both diff between
              # common_commit..HEAD and any locally staged files
              allFiles = __gitdiff(
                  "--name-only",
                  "--ignore-submodules",
                  "--staged",
                  f"{common_commit}",
              ).splitlines()
          else:
              # Fallback to just uncommitted files
              allFiles = uncommittedFiles()
  
      files = []
      for f in allFiles:
          if pathFilter is None or pathFilter(f):
              files.append(f)
  
      filesToCheckString = "\n\t".join(files) if files else "<None>"
      print(
          f"   [DEBUG] Found files to check:\n\t{filesToCheckString}\n"
      )
      return files
  
file_path: cuml/cpp/scripts/gitutils.py
imports: import subprocess
  import os
  import re
label_desc: Use image node_id 11 for calling a global function with example usage: modifiedFiles(pathFilter) and returns: files