code: def test_generates_correct_shards(
      self, num_examples, max_examples_per_shard, num_expected_shards
  ):
      data_dir = tempfile.mkdtemp("data_dir")
      writer = sequential_writer.SequentialWriter(
          ds_info=_dataset_info(data_dir),
          max_examples_per_shard=max_examples_per_shard,
      )
      writer.initialize_splits(["train"])
      for example in tfds.as_numpy(_generate_split(num_examples)):
          writer.add_examples({"train": [example]})
      writer.close_splits(["train"])
  
      ds_builder = tfds.builder_from_directory(data_dir)
      self.assertEqual(
          ds_builder.info.splits["train"].num_shards,
          num_expected_shards,
      )
      counter = (
          ds_builder.as_dataset(split="train")
          .reduce(0, lambda v, _: v + 1)
          .numpy()
      )
      self.assertEqual(counter, num_examples)
  
imports: import tempfile
  from absl.testing import absltest
  from absl.testing import parameterized
  import tensorflow
  import tensorflow_datasets
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import sequential_writer
label_desc: Use image node_id 1 for calling the SequentialWriterTest obj's underlying member method code with example usage: obj.test_generates_correct_shards(num_examples, max_examples_per_shard, num_expected_shards) without return types