code: def get_current_ref():
      ref = run_cmd("git rev-parse --abbrev-ref HEAD").strip()
      if ref == "HEAD":
          # The current ref is a detached HEAD, so grab its SHA.
          return run_cmd("git rev-parse HEAD").strip()
      else:
          return ref
  
imports: import json
  import os
  import re
  import subprocess
  import sys
  import traceback
  from urllib.request import urlopen
  from urllib.request import Request
  from urllib.error import HTTPError
label_desc: Use image node_id 14 for calling a global function with example usage: get_current_ref() and returns: run_cmd, ref