code: def process_voc_annotations(
      voc_annotation_path: str,
      voc_class_names_output_path: str,
      voc_annotation_xml_output_path: str,
  ) -> None:
      """
      Reads annotations for a dataset in VOC format.
      Then
          1. dumps the unique class names into labels.txt file.
          2. dumps the xml annotation file names into pathlist.txt file.
      Parameters
      ----------
      voc_annotation_path
          root_path for annotations in VOC format
      voc_class_names_output_path
          output path for the labels.txt
      voc_annotation_xml_output_path
          output path for the pathlist.txt
      Returns
      -------
          None
      """
      files = os.listdir(voc_annotation_path)
      annotation_path_base_name = os.path.basename(voc_annotation_path)
      class_names = set()
      xml_file_names = []
      for f in files:
          xml_path = os.path.join(voc_annotation_path, f)
          tree = ET.parse(xml_path)
          root = tree.getroot()
          for boxes in root.iter("object"):
              class_names.add(boxes.find("name").text)
  
          xml_file_names.append(
              os.path.join(annotation_path_base_name, f)
          )
  
      sorted_class_names = sorted(list(class_names))
      with open(voc_class_names_output_path, "w") as f:
          f.writelines("\n".join(sorted_class_names))
  
      with open(voc_annotation_xml_output_path, "w") as f:
          f.writelines("\n".join(xml_file_names))
  
imports: import json
  import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Union
  import defusedxml.ElementTree
  import numpy
  import pandas
  import PIL
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from ..constants import BBOX, LABEL, MAP, MAP_50, MAP_75, MAP_LARGE, MAP_MEDIUM, MAP_SMALL, MAR_1, MAR_10, MAR_100, MAR_LARGE, MAR_MEDIUM, MAR_SMALL, MEAN_AVERAGE_PRECISION
  from .download import download, is_url
label_desc: Use image node_id 25 for calling a global function with example usage: process_voc_annotations(voc_annotation_path, voc_class_names_output_path, voc_annotation_xml_output_path) without return types