class_docstr: Tests auto-sharding datasets with tf.data service.
class_docstr_tok: ["Tests","auto-sharding","datasets","with","tf.data","service","."]
code: def testTFRecordDataset_FewerFilesThanWorkers_DataShard(self):
      cluster = _make_service_cluster(
          num_workers=5, local_shard_index=3
      )
      dataset = dataset_ops.Dataset.list_files(
          self._filenames[:4], shuffle=False
      )
      dataset = dataset.flat_map(readers.TFRecordDataset)
      dataset = self.make_distributed_dataset(
          dataset,
          cluster=cluster,
          processing_mode=data_service_ops.ShardingPolicy.DATA,
      )
  
      expected = [
          b"Record %d of file %d" % (record, file)
          for file in range(0, 4)
          for record in (3, 8)
      ]
      self.assertDatasetProduces(
          dataset, expected, assert_items_equal=True
      )
  
imports: from absl.testing import parameterized
  from tensorflow.core.protobuf import data_service_pb2
  from tensorflow.python.data.experimental.kernel_tests.service import multi_process_cluster
  from tensorflow.python.data.experimental.kernel_tests.service import test_base
  from tensorflow.python.data.experimental.kernel_tests.service.multi_process_cluster import MultiProcessCluster
  from tensorflow.python.data.experimental.ops import data_service_ops
  from tensorflow.python.data.experimental.ops import distribute
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.kernel_tests import tf_record_test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import readers
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
label_desc: Use image node_id 20 for calling the AutoShardTest obj's underlying member method code with example usage: obj.testTFRecordDataset_FewerFilesThanWorkers_DataShard() without return types