code: def log_csv(df, metric_names=None, output_file=None):
      """Log scores to be copy/pasted into a spreadsheet."""
      logging.info(",".join(df.columns))
      metric_max, metric_max_step = metric_group_max(df, metric_names)
      max_row = "max," + ",".join(
          "{:.3f}".format(m) for m in metric_max
      )
      logging.info(max_row)
      idx_row = "step," + ",".join(
          "{:d}".format(i) for i in metric_max_step
      )
      logging.info(idx_row)
  
      if output_file is not None:
          with tf.io.gfile.GFile(output_file, "w") as f:
              csv_string = df.to_csv(float_format="%.3f")
              f.write(csv_string + max_row + "\n" + idx_row)
  
file_path: text-to-text-transfer-transformer/t5/evaluation/eval_utils.py
imports: import collections
  import os
  from absl import logging
  import numpy
  import pandas
  import tensorflow.compat.v1
  import tensorflow_datasets
label_desc: Use image node_id 7 for calling a global function with example usage: log_csv(df, metric_names, output_file) without return types