code: def _write_voc_results_file(self, all_boxes, output_dir):
      comp_id = "comp4"
      if self.config["use_salt"]:
          comp_id += "-{}".format(os.getpid())
  
      for cls_ind, cls in enumerate(self.classes):
          if cls == "__background__":
              continue
          print("Writing {} VOC results file".format(cls))
          filename = self._get_voc_results_file_template(
              output_dir
          ).format(cls)
          with open(filename, "wt") as f:
              for im_ind, index in enumerate(self.image_index):
                  dets = all_boxes[cls_ind][im_ind]
                  if dets == []:
                      continue
                  # the VOCdevkit expects 1-based indices
                  for k in range(dets.shape[0]):
                      f.write(
                          "{:s} {:.3f} {:.1f} {:.1f} {:.1f} {:.1f}\n".format(
                              index,
                              dets[k, -1],
                              dets[k, 0] + 1,
                              dets[k, 1] + 1,
                              dets[k, 2] + 1,
                              dets[k, 3] + 1,
                          )
                      )
      return comp_id
  
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 13 for calling the pascal_voc obj's underlying member method code with example usage: obj._write_voc_results_file(all_boxes, output_dir) and returns: comp_id