code: def convert_xml_to_json(input_path, output_path, difficult):
      if not os.path.exists(output_path):
          os.makedirs(output_path)
      onlyfiles = glob.glob(join(input_path, "*.xml"))
      onlyfiles.sort()
      for file in onlyfiles:
          outfile = join(output_path, os.path.basename(file))
          outfile = os.path.splitext(outfile)[0] + ".json"
          trimmed = parse_single_file(join(input_path, file), difficult)
          if validate_metadata(trimmed, file):
              result = json.dumps(
                  trimmed,
                  sort_keys=True,
                  indent=4,
                  separators=(",", ": "),
              )
              f = open(outfile, "w")
              f.write(result)
          else:
              print("error parsing metadata {0}").format(file)
  
file_path: neon/examples/faster-rcnn/convert_xml_to_json.py
imports: import json
  import glob
  import collections
  import os
  from os.path import join
  import xml.etree.ElementTree
  from collections import defaultdict
  import argparse
label_desc: Use image node_id 3 for calling a global function with example usage: convert_xml_to_json(input_path, output_path, difficult) without return types