code: def latest_tlcpackstaging_image(source: str) -> Optional[str]:
      """
      Finds the latest full tag to use in the Jenkinsfile or returns None if no
      update is needed
      """
      name, current_tag = source.split(":")
      user, repo = name.split("/")
      logging.info(
          f"Running with name: {name}, current_tag: {current_tag}, user: {user}, repo: {repo}"
      )
  
      staging_repo = repo.replace("-", "_")
      latest_tlcpackstaging_tag = latest_tag(
          user="tlcpackstaging", repo=staging_repo
      )
      logging.info(
          f"Found latest tlcpackstaging tag:\n{latest_tlcpackstaging_tag}"
      )
  
      if latest_tlcpackstaging_tag["name"] == current_tag:
          logging.info(
              f"tlcpackstaging tag is the same as the one in the Jenkinsfile"
          )
  
      latest_tlcpack_tag = latest_tag(user="tlcpack", repo=repo)
      logging.info(f"Found latest tlcpack tag:\n{latest_tlcpack_tag}")
  
      if (
          latest_tlcpack_tag["name"]
          == latest_tlcpackstaging_tag["name"]
      ):
          logging.info("Tag names were the same, no update needed")
          return None
  
      if (
          latest_tlcpack_tag["last_updated"]
          > latest_tlcpackstaging_tag["last_updated"]
      ):
          new_spec = f"tlcpack/{repo}:{latest_tlcpack_tag['name']}"
      else:
          # Even if the image doesn't exist in tlcpack, it will fall back to tlcpackstaging
          # so hardcode the username here
          new_spec = (
              f"tlcpack/{repo}:{latest_tlcpackstaging_tag['name']}"
          )
          logging.info("Using tlcpackstaging tag on tlcpack")
  
      logging.info(f"Found newer image, using: {new_spec}")
      return new_spec
  
file_path: tvm/ci/scripts/jenkins/open_docker_update_pr.py
imports: import argparse
  import logging
  import datetime
  import os
  import json
  import re
  import shlex
  from urllib import error
  from typing import List, Dict, Any, Optional, Callable
  from git_utils import git, parse_remote, GitHubRepo
  from cmd_utils import REPO_ROOT, init_log
  from should_rebuild_docker import docker_api
label_desc: Use image node_id 5 for calling a global function with example usage: latest_tlcpackstaging_image(source) and returns: new_spec, None