code: def does_commit_exist(hash: str) -> bool:
      """
      Returns True if the hash exists in the repo
      """
      sh = Sh()
      cmd = f"git rev-parse -q {hash}"
      proc = sh.run(
          cmd,
          stdout=subprocess.PIPE,
          stderr=subprocess.STDOUT,
          check=False,
      )
      print(proc.stdout)
      if proc.returncode == 0:
          return True
  
      if (
          "unknown revision or path not in the working tree"
          in proc.stdout
      ):
          return False
  
      raise RuntimeError(f"Unexpected failure when running: {cmd}")
  
file_path: tvm/ci/scripts/jenkins/should_rebuild_docker.py
imports: import argparse
  import datetime
  import json
  import logging
  import subprocess
  from typing import Dict, Any, List
  from http_utils import get
  from cmd_utils import Sh, init_log
label_desc: Use image node_id 3 for calling a global function with example usage: does_commit_exist(hash) and returns: True, False