code: def testCustomShardFunction(self):
      dataset = dataset_ops.Dataset.range(42)
      self.evaluate(
          io.save(dataset, self._test_dir, shard_func=lambda x: x // 21)
      )
      dataset2 = io.load(self._test_dir, dataset.element_spec)
      expected = []
      for i in range(21):
          expected.extend([i, i + 21])
      self.assertDatasetProduces(dataset2, expected)
  
imports: import os
  import shutil
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.experimental.ops import io
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the IOTest obj's underlying member method code with example usage: obj.testCustomShardFunction() without return types