code: def find_commit_in_repo(tags: List[Dict[str, Any]]):
      """
      Look through all the docker tags, find the most recent one which references
      a commit that is present in the repo
      """
      for tag in tags["results"]:
          shorthash = find_hash_for_tag(tag)
          logging.info(f"Hash '{shorthash}' does not exist in repo")
          if does_commit_exist(shorthash):
              return shorthash, tag
  
      raise RuntimeError(f"No extant hash found in tags:\n{tags}")
  
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 5 for calling a global function with example usage: find_commit_in_repo(tags) and returns: shorthash,  tag