code: def prepare_metadata(
      class_info_file, repo_path="shi-labs/oneformer_demo"
  ):
      with open(
          hf_hub_download(
              repo_path, class_info_file, repo_type="dataset"
          ),
          "r",
      ) as f:
          class_info = json.load(f)
      metadata = {}
      class_names = []
      thing_ids = []
  
      for key, info in class_info.items():
          metadata[key] = info["name"]
          class_names.append(info["name"])
          if info["isthing"]:
              thing_ids.append(int(key))
  
      metadata["thing_ids"] = thing_ids
      metadata["class_names"] = class_names
      return metadata
  
imports: import json
  import os
  import tempfile
  import unittest
  import numpy
  from datasets import load_dataset
  from huggingface_hub import hf_hub_download
  from transformers.testing_utils import check_json_file_has_correct_format, require_torch, require_vision
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_image_processing_common import prepare_image_inputs
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_metadata(class_info_file, repo_path) and returns: metadata