code: def testOutputSharding(self):
      problem = FakeDistributedProblemNotPerSplit()
  
      # self.dataset_split is 2, 3, 4
      # So:
      # num output shards = 2 + 3 + 4 = 9
      # task_ids will be in range = [0, 9)
  
      expected_split_shard_and_offset = [
          (problem_lib.DatasetSplit.TRAIN, 2, 0),
          (problem_lib.DatasetSplit.TRAIN, 2, 1),
          (problem_lib.DatasetSplit.EVAL, 3, 0),
          (problem_lib.DatasetSplit.EVAL, 3, 1),
          (problem_lib.DatasetSplit.EVAL, 3, 2),
          (problem_lib.DatasetSplit.TEST, 4, 0),
          (problem_lib.DatasetSplit.TEST, 4, 1),
          (problem_lib.DatasetSplit.TEST, 4, 2),
          (problem_lib.DatasetSplit.TEST, 4, 3),
      ]
  
      expected_output_filenames = [
          "/tmp/fake_distributed_problem-unshuffled-train-00000-of-00002",
          "/tmp/fake_distributed_problem-unshuffled-train-00001-of-00002",
          "/tmp/fake_distributed_problem-unshuffled-dev-00000-of-00003",
          "/tmp/fake_distributed_problem-unshuffled-dev-00001-of-00003",
          "/tmp/fake_distributed_problem-unshuffled-dev-00002-of-00003",
          "/tmp/fake_distributed_problem-unshuffled-test-00000-of-00004",
          "/tmp/fake_distributed_problem-unshuffled-test-00001-of-00004",
          "/tmp/fake_distributed_problem-unshuffled-test-00002-of-00004",
          "/tmp/fake_distributed_problem-unshuffled-test-00003-of-00004",
      ]
  
      actual_split_shard_and_offset = []
      actual_output_filenames = []
      for task_id in range(9):
          actual_split_shard_and_offset.append(
              problem._task_id_to_output_split(task_id)
          )
          actual_output_filenames.append(
              problem._task_id_to_output_file("/tmp", task_id)
          )
  
      self.assertSequenceEqual(
          expected_split_shard_and_offset, actual_split_shard_and_offset
      )
  
      self.assertSequenceEqual(
          expected_output_filenames, actual_output_filenames
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the DistributedText2TextProblemsTest obj's underlying member method code with example usage: obj.testOutputSharding() without return types