code: def prep_data(decode_dir, target_dir):
      with open(FLAGS.decodes_filename, "rb") as fdecodes:
          with open(FLAGS.targets_filename, "rb") as ftargets:
              for i, (d, t) in enumerate(zip(fdecodes, ftargets)):
                  write_to_file(
                      os.path.join(
                          decode_dir, "rouge.%06d.txt" % (i + 1)
                      ),
                      d,
                  )
                  write_to_file(
                      os.path.join(
                          target_dir, "rouge.A.%06d.txt" % (i + 1)
                      ),
                      t,
                  )
                  if (i + 1 % 1000) == 0:
                      tf.logging.info("Written %d examples to file" % i)
  
file_path: tensor2tensor/tensor2tensor/utils/get_rouge.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import os
  import shutil
  from tempfile import mkdtemp
  import pyrouge
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: prep_data(decode_dir, target_dir) without return types