code: def test_log_csv(self):
      metric_names = list(eval_utils.METRIC_NAMES.values())
      df = pd.DataFrame(
          collections.OrderedDict(
              [
                  (metric_names[0].name, [np.nan, 1.0, 2.0]),
                  (metric_names[1].name, [3.0, np.nan, np.nan]),
                  (metric_names[2].name, [4.0, np.nan, np.nan]),
              ]
          ),
          index=[10, 20, 30],
      )
      df.index.name = "step"
      output_file = os.path.join(
          self.create_tempdir().full_path, "results.csv"
      )
      eval_utils.log_csv(df, output_file=output_file)
      with tf.io.gfile.GFile(output_file) as f:
          output = f.read()
      expected = """step,{},{},{}
  10,,3.000,4.000
  20,1.000,,
  30,2.000,,
  max,2.000,3.000,4.000
  step,30,10,10""".format(
          *[m.name for m in metric_names[:3]]
      )
      self.assertEqual(output, expected)
  
file_path: text-to-text-transfer-transformer/t5/evaluation/eval_utils_test.py
imports: import collections
  import os
  from absl.testing import absltest
  import numpy
  import pandas
  import seqio
  from t5.evaluation import eval_utils
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling the EvalUtilsTest obj's underlying member method code with example usage: obj.test_log_csv() without return types