code: def main(_):
      flags.mark_flags_as_required(["task"])
  
      if FLAGS.module_import:
          import_modules(FLAGS.module_import)
  
      # Load gin parameters if they've been defined.
      try:
          for gin_file_path in FLAGS.gin_location_prefix:
              gin.add_config_file_search_path(gin_file_path)
          gin.parse_config_files_and_bindings(
              FLAGS.gin_file, FLAGS.gin_param
          )
      except AttributeError:
          # Otherwise, use default settings.
          gin.parse_config_files_and_bindings(None, None)
  
      total_examples = 0
      if FLAGS.task is not None:
          task_or_mixture = seqio.TaskRegistry.get(FLAGS.task)
      elif FLAGS.mixture is not None:
          task_or_mixture = seqio.MixtureRegistry.get(FLAGS.mixture)
  
      ds = task_or_mixture.get_dataset(
          sequence_length=sequence_length(),
          split=FLAGS.split,
          use_cached=False,
          shuffle=FLAGS.shuffle,
      )
  
      keys = re.findall(r"{([\w+]+)}", FLAGS.format_string)
  
      def _example_to_string(ex):
          key_to_string = {}
          for k in keys:
              if k not in ex:
                  key_to_string[k] = ""
                  continue
              value = ex[k]
              if FLAGS.detokenize:
                  try:
                      value = task_or_mixture.output_features[
                          k
                      ].vocabulary.decode_tf(tf.abs(value))
                  except RuntimeError as err:
                      value = f"Error {err} while decoding {value}"
                  if (
                      FLAGS.apply_postprocess_fn
                      and k == "targets"
                      and hasattr(task_or_mixture, "postprocess_fn")
                  ):
                      value = task_or_mixture.postprocess_fn(value)
              if tf.rank(value) == 0:
                  value = [value]
              if tf.is_numeric_tensor(value):
                  value = tf.strings.format(
                      "{}", tf.squeeze(value), summarize=-1
                  )
              else:
                  value = tf.strings.join(value, separator="\n\n")
              key_to_string[k] = pretty(value.numpy().decode("utf-8"))
          return FLAGS.format_string.format(**key_to_string)
  
      for ex in ds:
          print(_example_to_string(ex))
          total_examples += 1
          if total_examples == FLAGS.max_examples:
              break
      return
  
file_path: text-to-text-transfer-transformer/t5/scripts/dump_task.py
imports: import importlib
  import re
  from absl import app
  from absl import flags
  import gin
  import seqio
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: main(_) and returns: FLAGS