code: def test_main(self, **flags):
      mock_task = get_mocked_task(
          flags["task"] if "task" in flags else flags["mixture"]
      )
      self.enter_context(
          mock.patch.object(
              seqio.TaskRegistry, "get", return_value=mock_task
          )
      )
      self.enter_context(
          mock.patch.object(
              seqio.MixtureRegistry, "get", return_value=mock_task
          )
      )
      with flagsaver.flagsaver(**flags):
          dump_task.main(None)
          if "task" in flags:
              seqio.TaskRegistry.get.assert_called_once_with(
                  flags["task"]
              )
          if "mixture" in flags:
              seqio.MixtureRegistry.get.assert_called_once_with(
                  flags["mixture"]
              )
          mock_task.get_dataset.assert_called_once()
          if "detokenize" in flags:
              # Once per input, negative input and target
              self.assertEqual(
                  mock_task.mock_vocab.decode_tf.call_count, 3
              )
              if "apply_postprocess_fn" in flags:
                  # Once for target
                  mock_task.postprocess_fn.assert_called_once()
  
file_path: text-to-text-transfer-transformer/t5/scripts/dump_task_test.py
imports: from unittest import mock
  from absl.testing import flagsaver
  from absl.testing import parameterized
  import gin
  import seqio
  from t5.scripts import dump_task
  import tensorflow
label_desc: Use image node_id 4 for calling the DumpTaskTest obj's underlying member method code with example usage: obj.test_main() without return types