code: def print_csv_format(results):
      """
      Print main metrics in a format similar to Detectron,
      so that they are easy to copypaste into a spreadsheet.
  
      Args:
          results (OrderedDict[dict]): task_name -> {metric -> score}
              unordered dict can also be printed, but in arbitrary order
      """
      assert isinstance(results, Mapping) or not len(results), results
      logger = logging.getLogger(__name__)
      for task, res in results.items():
          if isinstance(res, Mapping):
              # Don't print "AP-category" metrics since they are usually not tracked.
              important_res = [
                  (k, v) for k, v in res.items() if "-" not in k
              ]
              logger.info("copypaste: Task: {}".format(task))
              logger.info(
                  "copypaste: "
                  + ",".join([k[0] for k in important_res])
              )
              logger.info(
                  "copypaste: "
                  + ",".join(
                      ["{0:.4f}".format(k[1]) for k in important_res]
                  )
              )
          else:
              logger.info(f"copypaste: {task}={res}")
  
file_path: detectron2/detectron2/evaluation/testing.py
imports: import logging
  import numpy
  import pprint
  import sys
  from collections.abc import Mapping
label_desc: Use image node_id 1 for calling a global function with example usage: print_csv_format(results) without return types