code: def write_results(detections, filename):
      """Write prediction results into official formats."""
      start = time.time()
  
      boxes, labels, scores = detections
      with pathmgr.open(filename, "w") as f:
          for key in boxes.keys():
              for box, label, score in zip(
                  boxes[key], labels[key], scores[key]
              ):
                  f.write(
                      "%s,%.03f,%.03f,%.03f,%.03f,%d,%.04f\n"
                      % (
                          key,
                          box[1],
                          box[0],
                          box[3],
                          box[2],
                          label,
                          score,
                      )
                  )
  
      logger.info("AVA results wrote to %s" % filename)
      logger.info("\ttook %d seconds." % (time.time() - start))
  
file_path: SlowFast/slowfast/utils/ava_eval_helper.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import csv
  import logging
  import pprint
  import time
  from collections import defaultdict
  import numpy
  import slowfast.utils.distributed
  from ava_evaluation import object_detection_evaluation, standard_fields
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 9 for calling a global function with example usage: write_results(detections, filename) without return types