code: def get_job_links(workflow_run_id, token=None):
      """Extract job names and their job links in a GitHub Actions workflow run"""
  
      headers = None
      if token is not None:
          headers = {
              "Accept": "application/vnd.github+json",
              "Authorization": f"Bearer {token}",
          }
  
      url = f"https://api.github.com/repos/huggingface/transformers/actions/runs/{workflow_run_id}/jobs?per_page=100"
      result = requests.get(url, headers=headers).json()
      job_links = {}
  
      try:
          job_links.update(
              {job["name"]: job["html_url"] for job in result["jobs"]}
          )
          pages_to_iterate_over = math.ceil(
              (result["total_count"] - 100) / 100
          )
  
          for i in range(pages_to_iterate_over):
              result = requests.get(
                  url + f"&page={i + 2}", headers=headers
              ).json()
              job_links.update(
                  {
                      job["name"]: job["html_url"]
                      for job in result["jobs"]
                  }
              )
  
          return job_links
      except Exception:
          print(
              f"Unknown error, could not fetch links:\n{traceback.format_exc()}"
          )
  
      return {}
  
file_path: transformers/utils/get_ci_error_statistics.py
imports: import argparse
  import json
  import math
  import os
  import time
  import traceback
  import zipfile
  from collections import Counter
  import requests
label_desc: Use image node_id 1 for calling a global function with example usage: get_job_links(workflow_run_id, token) and returns: dict, job_links