code: def _do_python_eval(self, output_dir="output", use_07_metric=None):
      annopath = os.path.join(
          self._devkit_path, "VOC" + self._year, "Annotations", "{}.xml"
      )
      imagesetfile = os.path.join(
          self._devkit_path,
          "VOC" + self._year,
          "ImageSets",
          "Main",
          self._image_set + ".txt",
      )
      aps = []
      # The PASCAL VOC metric changed in 2010
      if use_07_metric == None:
          use_07_metric = True if int(self._year) < 2010 else False
  
      print("VOC07 metric? " + ("Yes" if use_07_metric else "No"))
      if not os.path.isdir(output_dir):
          os.mkdir(output_dir)
      for i, cls in enumerate(self._classes):
          if cls == "__background__":
              continue
          filename = self._get_voc_results_file_template(
              output_dir
          ).format(cls)
  
          rec, prec, ap = voc_eval(
              filename,
              annopath,
              imagesetfile,
              cls,
              cachedir=output_dir,
              ovthresh=0.5,
              use_07_metric=use_07_metric,
          )
          aps += [ap]
          print("AP for {} = {:.4f}".format(cls, ap))
          with open(
              os.path.join(output_dir, cls + "_pr.pkl"), "wb"
          ) as f:
              cp.dump({"rec": rec, "prec": prec, "ap": ap}, f)
      print("Mean AP = {:.4f}".format(np.mean(aps)))
      # print('~~~~~~~~')
      # print('Results:')
      # for ap in aps:
      #     print('{:.3f}'.format(ap))
      # print('{:.3f}'.format(np.mean(aps)))
      # print('~~~~~~~~')
      # print('')
      print(
          "--------------------------------------------------------------"
      )
      print(
          "Results computed with the **unofficial** Python eval code."
      )
      print(
          "Results should be very close to the official MATLAB eval code."
      )
      print(
          "Recompute with `./tools/reval.py --matlab ...` for your paper."
      )
      print("-- Thanks, The Management")
  
imports: from __future__ import print_function
  import os, pdb
  import xml.dom.minidom
  import numpy
  import scipy.sparse
  import scipy.io
  import pickle
  import subprocess
  from .imdb import imdb
  from .voc_eval import voc_eval
label_desc: Use image node_id 18 for calling the pascal_voc obj's underlying member method code with example usage: obj._do_python_eval(output_dir, use_07_metric) without return types