code: def sort_columns(df, metric_names=None):
      metric_names = metric_names or METRIC_NAMES
      column_order = list(
          collections.OrderedDict.fromkeys(
              [
                  m.name
                  for m in metric_names.values()
                  if m.name in df.columns
              ]
          )
      )
      return df.reindex(columns=column_order)
  
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 3 for calling a global function with example usage: sort_columns(df, metric_names) and returns: df