code: def update_metadata(token: str, commit_sha: str):
      """
      Update the metadata for the Transformers repo in `huggingface/transformers-metadata`.
  
      Args:
          token (`str`): A valid token giving write access to `huggingface/transformers-metadata`.
          commit_sha (`str`): The commit SHA on Transformers corresponding to this update.
      """
      frameworks_table = get_frameworks_table()
      frameworks_dataset = Dataset.from_pandas(frameworks_table)
  
      resolved_tags_file = hf_hub_download(
          "huggingface/transformers-metadata",
          "pipeline_tags.json",
          repo_type="dataset",
          token=token,
      )
      tags_dataset = Dataset.from_json(resolved_tags_file)
      table = {
          tags_dataset[i]["model_class"]: (
              tags_dataset[i]["pipeline_tag"],
              tags_dataset[i]["auto_class"],
          )
          for i in range(len(tags_dataset))
      }
      table = update_pipeline_and_auto_class_table(table)
  
      # Sort the model classes to avoid some nondeterministic updates to create false update commits.
      model_classes = sorted(table.keys())
      tags_table = pd.DataFrame(
          {
              "model_class": model_classes,
              "pipeline_tag": [table[m][0] for m in model_classes],
              "auto_class": [table[m][1] for m in model_classes],
          }
      )
      tags_dataset = Dataset.from_pandas(tags_table)
  
      with tempfile.TemporaryDirectory() as tmp_dir:
          frameworks_dataset.to_json(
              os.path.join(tmp_dir, "frameworks.json")
          )
          tags_dataset.to_json(
              os.path.join(tmp_dir, "pipeline_tags.json")
          )
  
          if commit_sha is not None:
              commit_message = (
                  f"Update with commit {commit_sha}\n\nSee: "
                  f"https://github.com/huggingface/transformers/commit/{commit_sha}"
              )
          else:
              commit_message = "Update"
  
          upload_folder(
              repo_id="huggingface/transformers-metadata",
              folder_path=tmp_dir,
              repo_type="dataset",
              token=token,
              commit_message=commit_message,
          )
  
file_path: transformers/utils/update_metadata.py
imports: import argparse
  import collections
  import os
  import re
  import tempfile
  from typing import Dict, List, Tuple
  import pandas
  from datasets import Dataset
  from huggingface_hub import hf_hub_download, upload_folder
  from transformers.utils import direct_transformers_import
label_desc: Use image node_id 4 for calling a global function with example usage: update_metadata(token, commit_sha) without return types