code: def download_artifact(artifact_name, artifact_url, output_dir, token):
      """Download a GitHub Action artifact from a URL.
  
      The URL is of the form `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
      """
      headers = None
      if token is not None:
          headers = {
              "Accept": "application/vnd.github+json",
              "Authorization": f"Bearer {token}",
          }
  
      result = requests.get(
          artifact_url, headers=headers, allow_redirects=False
      )
      download_url = result.headers["Location"]
      response = requests.get(download_url, allow_redirects=True)
      file_path = os.path.join(output_dir, f"{artifact_name}.zip")
      with open(file_path, "wb") as fp:
          fp.write(response.content)
  
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 3 for calling a global function with example usage: download_artifact(artifact_name, artifact_url, output_dir, token) without return types