code: def changed_files(base_branch=None):
      """Get the list of changed or added files from git."""
      if os.path.exists(os.path.join(SRCDIR, ".git")):
          # We just use an existence check here as:
          #  directory = normal git checkout/clone
          #  file = git worktree directory
          if base_branch:
              cmd = "git diff --name-status " + base_branch
          else:
              cmd = "git status --porcelain"
          filenames = []
          with subprocess.Popen(
              cmd.split(), stdout=subprocess.PIPE, cwd=SRCDIR
          ) as st:
              git_file_status, _ = st.communicate()
              if st.returncode != 0:
                  sys.exit(f"error running {cmd}")
              for line in git_file_status.splitlines():
                  line = line.decode().rstrip()
                  status_text, filename = line.split(maxsplit=1)
                  status = set(status_text)
                  # modified, added or unmerged files
                  if not status.intersection("MAU"):
                      continue
                  if " -> " in filename:
                      # file is renamed
                      filename = filename.split(" -> ", 2)[1].strip()
                  filenames.append(filename)
      else:
          sys.exit("need a git checkout to get modified files")
  
      filenames2 = []
      for filename in filenames:
          # Normalize the path to be able to match using .startswith()
          filename = os.path.normpath(filename)
          if any(filename.startswith(path) for path in EXCLUDE_DIRS):
              # Exclude the file
              continue
          filenames2.append(filename)
  
      return filenames2
  
imports: import re
  import sys
  import shutil
  import os.path
  import subprocess
  import sysconfig
  import reindent
  import untabify
label_desc: Use image node_id 8 for calling a global function with example usage: changed_files(base_branch) and returns: filenames2