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. Else, lists 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.")
          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: cugraph/ci/utils/git_helpers.py
imports: import subprocess
  import os
  import re
label_desc: Use image node_id 8 for calling a global function with example usage: modifiedFiles(pathFilter) and returns: files