code: def get_git_upstream_remote():
      """Get the remote name to use for upstream branches
  
      Uses "upstream" if it exists, "origin" otherwise
      """
      cmd = "git remote get-url upstream".split()
      try:
          subprocess.check_output(
              cmd,
              stderr=subprocess.DEVNULL,
              cwd=SRCDIR,
              encoding="UTF-8",
          )
      except subprocess.CalledProcessError:
          return "origin"
      return "upstream"
  
imports: import re
  import sys
  import shutil
  import os.path
  import subprocess
  import sysconfig
  import reindent
  import untabify
label_desc: Use image node_id 5 for calling a global function with example usage: get_git_upstream_remote() and returns: str, str