code: def test_4buckets_2shards(self):
      specs = writer_lib._get_shard_specs(
          num_examples=8,
          total_size=16,
          bucket_lengths=[2, 3, 0, 3],
          filename_template=naming.ShardedFileTemplate(
              dataset_name="bar",
              split="train",
              data_dir="/",
              filetype_suffix="tfrecord",
          ),
          shard_config=shard_utils.ShardConfig(num_shards=2),
      )
      self.assertEqual(
          specs,
          [
              # Shard#, path, examples_number, reading instructions.
              _ShardSpec(
                  0,
                  "/bar-train.tfrecord-00000-of-00002",
                  "/bar-train.tfrecord-00000-of-00002_index.json",
                  4,
                  [
                      shard_utils.FileInstruction(
                          filename="0",
                          skip=0,
                          take=2,
                          examples_in_shard=2,
                      ),
                      shard_utils.FileInstruction(
                          filename="1",
                          skip=0,
                          take=2,
                          examples_in_shard=3,
                      ),
                  ],
              ),
              _ShardSpec(
                  1,
                  "/bar-train.tfrecord-00001-of-00002",
                  "/bar-train.tfrecord-00001-of-00002_index.json",
                  4,
                  [
                      shard_utils.FileInstruction(
                          filename="1",
                          skip=2,
                          take=-1,
                          examples_in_shard=3,
                      ),
                      shard_utils.FileInstruction(
                          filename="3",
                          skip=0,
                          take=-1,
                          examples_in_shard=3,
                      ),
                  ],
              ),
          ],
      )
  
imports: import json
  import os
  from typing import Optional
  from unittest import mock
  from etils import epath
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import lazy_imports_lib
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import writer
  from tensorflow_datasets.core.utils import shard_utils
  from tensorflow_datasets.core.writer import _ShardSpec
label_desc: Use image node_id 2 for calling the GetShardSpecsTest obj's underlying member method code with example usage: obj.test_4buckets_2shards() without return types