code: def read_xml(path):
      with tf.gfile.GFile(path) as f:
          root = etree.fromstring(f.read())
  
      annotations = {}
      for node in root.getchildren():
          key, val = node2dict(node)
          # If `key` is object, it's actually a list.
          if key == "object":
              annotations.setdefault(key, []).append(val)
          else:
              annotations[key] = val
  
      return annotations
  
file_path: luminoth/luminoth/utils/dataset.py
imports: import tensorflow
  from lxml import etree
label_desc: Use image node_id 2 for calling a global function with example usage: read_xml(path) and returns: annotations