code: def find_hierarchy_parent(hierarchy, parent_cls):
      if hierarchy["LabelName"] == parent_cls:
          return hierarchy
      elif "Subcategory" in hierarchy:
          for child in hierarchy["Subcategory"]:
              res = find_hierarchy_parent(child, parent_cls)
              if res is not None:
                  return res
  
      return None
  
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 3 for calling a global function with example usage: find_hierarchy_parent(hierarchy, parent_cls) and returns: None, hierarchy, res