code: def tocsv(
      eval_objects, metric_names=None, float_format="{:.3f}", **kwargs
  ):
      """
      Format the given evaluation objects as a CSV table.
  
      Parameters
      ----------
      eval_objects : list
          Evaluation objects.
      metric_names : list of tuples, optional
          List of tuples defining the name of the property corresponding to the
          metric, and the metric label e.g. ('fp', 'False Positives').
      float_format : str, optional
          How to format the metrics.
  
      Returns
      -------
      str
          CSV table representation of the evaluation objects.
  
      Notes
      -----
      If no `metric_names` are given, they will be extracted from the first
      evaluation object.
  
      """
      # pylint: disable=unused-argument
  
      if metric_names is None:
          # get the evaluation metrics from the first evaluation object
          metric_names = eval_objects[0].METRIC_NAMES
      metric_names, metric_labels = list(zip(*metric_names))
      # add header
      lines = ["Name," + ",".join(metric_labels)]
      # TODO: use e.metrics dict?
      # add the evaluation objects
      for e in eval_objects:
          values = [
              float_format.format(getattr(e, mn)) for mn in metric_names
          ]
          lines.append(e.name + "," + ",".join(values))
      # return everything
      return "\n".join(lines)
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from .None import chords, beats, notes, onsets, tempo
  from .beats import BeatEvaluation, BeatMeanEvaluation
  from .chords import ChordEvaluation, ChordMeanEvaluation, ChordSumEvaluation
  from .key import KeyEvaluation, KeyMeanEvaluation
  from .notes import NoteEvaluation, NoteMeanEvaluation, NoteSumEvaluation
  from .onsets import OnsetEvaluation, OnsetMeanEvaluation, OnsetSumEvaluation
  from .tempo import TempoEvaluation, TempoMeanEvaluation
label_desc: Use image node_id 6 for calling a global function with example usage: tocsv(eval_objects, metric_names, float_format) and returns: str