code: def download_artifact(artifact_name, artifact_url, output_dir, token):
      """Download a GitHub Action artifact from a URL.
  
      The URL is of the from `https://api.github.com/repos/huggingface/transformers/actions/artifacts/{ARTIFACT_ID}/zip`,
      but it can't be used to download directly. We need to get a redirect URL first.
      See https://docs.github.com/en/rest/actions/artifacts#download-an-artifact
      """
      # Get the redirect URL first
      cmd = f'curl -v -H "Accept: application/vnd.github+json" -H "Authorization: token {token}" {artifact_url}'
      output = subprocess.run(
          cmd,
          shell=True,
          stdout=subprocess.PIPE,
          stderr=subprocess.STDOUT,
      )
      o = output.stdout.decode("utf-8")
      lines = o.splitlines()
  
      for line in lines:
          if line.startswith("< Location: "):
              redirect_url = line[len("< Location: ") :]
              r = requests.get(redirect_url, allow_redirects=True)
              p = os.path.join(output_dir, f"{artifact_name}.zip")
              open(p, "wb").write(r.content)
              break
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/utils/get_ci_error_statistics.py
imports: import argparse
  import json
  import math
  import os
  import subprocess
  import time
  import zipfile
  from collections import Counter
  import requests
label_desc: Use image node_id 3 for calling a global function with example usage: download_artifact(artifact_name, artifact_url, output_dir, token) without return types