code: def get_hash_or_pr_url(commit: Commit):
      # cdc = get_commit_data_cache()
      pr_link = commit.pr_link
      if pr_link is None:
          return commit.commit_hash
      else:
          regex = r"https://github.com/pytorch/pytorch/pull/([0-9]+)"
          matches = re.findall(regex, pr_link)
          if len(matches) == 0:
              return commit.commit_hash
  
          return f"[#{matches[0]}]({pr_link})"
  
imports: import argparse
  import csv
  import dataclasses
  import os
  import pprint
  import re
  from collections import defaultdict
  from pathlib import Path
  from typing import List
  import common
  from common import features_to_dict, frontend_categories, get_commit_data_cache, get_features, run, topics
label_desc: Use image node_id 4 for calling a global function with example usage: get_hash_or_pr_url(commit) and returns: commit, str, matches, str, pr_link, str, commit