code: def _expand_label_hierarchy(labels, config, expand_child=True):
      keyed_nodes = config._hierarchy_keyed_parent
      if expand_child:
          keyed_nodes = config._hierarchy_keyed_child
  
      additional_labs = []
      for lab in labels:
          if lab in keyed_nodes:
              additional_labs += list(keyed_nodes[lab])
  
      return list(set(labels + additional_labs))
  
imports: from collections import defaultdict
  from copy import deepcopy
  import numpy
  import fiftyone.core.plots
  import fiftyone.utils.iou
  from .detection import DetectionEvaluation, DetectionEvaluationConfig, DetectionResults
label_desc: Use image node_id 1 for calling a global function with example usage: _expand_label_hierarchy(labels, config, expand_child) and returns: list