code: def load_hierarchy(metadata_dir, version="v4"):
      hierarchy = None
      if version == "challenge2018":
          hierarchy = "bbox_labels_500_hierarchy.json"
      elif version == "v4":
          hierarchy = "bbox_labels_600_hierarchy.json"
      elif version == "v3":
          hierarchy = "bbox_labels_600_hierarchy.json"
  
      hierarchy_json = os.path.join(metadata_dir, hierarchy)
      with open(hierarchy_json) as f:
          hierarchy_data = json.loads(f.read())
  
      return hierarchy_data
  
imports: import csv
  import json
  import os
  import warnings
  import numpy
  from PIL import Image
  from .generator import Generator
  from ..utils.image import read_image_bgr
label_desc: Use image node_id 1 for calling a global function with example usage: load_hierarchy(metadata_dir, version) and returns: hierarchy_data