code: def listFilesToCheck(filesDirs, pathFilter=None):
      """
      Utility function to filter the input list of files/dirs based on the input
      pathFilter method and returns all the files that need to be checked
      """
      allFiles = []
      for f in filesDirs:
          if os.path.isfile(f):
              if pathFilter is None or pathFilter(f):
                  allFiles.append(f)
          elif os.path.isdir(f):
              files = listAllFilesInDir(f)
              for f_ in files:
                  if pathFilter is None or pathFilter(f_):
                      allFiles.append(f_)
      return allFiles
  
file_path: cugraph/ci/utils/git_helpers.py
imports: import subprocess
  import os
  import re
label_desc: Use image node_id 10 for calling a global function with example usage: listFilesToCheck(filesDirs, pathFilter) and returns: allFiles