code: def voc(
      annotations_dir: Union[str, Path],
      images_dir: Union[str, Path],
      class_map: Optional[ClassMap] = None,
      masks_dir: Optional[Union[str, Path]] = None,
      idmap: Optional[IDMap] = None,
  ):
      logger.warning(
          "This function will be deprecated, instantiate the concrete "
          "classes instead: `VOCBBoxParser`, `VOCMaskParser`"
      )
      if not masks_dir:
          return VOCBBoxParser(
              annotations_dir=annotations_dir,
              images_dir=images_dir,
              class_map=class_map,
              idmap=idmap,
          )
      else:
          return VOCMaskParser(
              annotations_dir=annotations_dir,
              images_dir=images_dir,
              masks_dir=masks_dir,
              class_map=class_map,
              idmap=idmap,
          )
  
imports: import xml.etree.ElementTree
  from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.parsers.parser import *
label_desc: Use image node_id 1 for calling a global function with example usage: voc(annotations_dir, images_dir, class_map, masks_dir, idmap) and returns: VOCBBoxParser, VOCMaskParser