code: def test_shard_api():
      si = tfds.core.SplitInfo(
          name="train",
          shard_lengths=[10, 20, 13],
          num_bytes=0,
          filename_template=naming.ShardedFileTemplate(
              dataset_name="ds_name",
              split="train",
              filetype_suffix="tfrecord",
              data_dir="/path",
          ),
      )
      fi = [
          shard_utils.FileInstruction(
              filename="/path/ds_name-train.tfrecord-00000-of-00003",
              skip=0,
              take=-1,
              examples_in_shard=10,
          ),
          shard_utils.FileInstruction(
              filename="/path/ds_name-train.tfrecord-00001-of-00003",
              skip=0,
              take=-1,
              examples_in_shard=20,
          ),
          shard_utils.FileInstruction(
              filename="/path/ds_name-train.tfrecord-00002-of-00003",
              skip=0,
              take=-1,
              examples_in_shard=13,
          ),
      ]
      sd = splits.SplitDict([si])
      assert sd["train[0shard]"].file_instructions == [fi[0]]
      assert sd["train[1shard]"].file_instructions == [fi[1]]
      assert sd["train[-1shard]"].file_instructions == [fi[-1]]
      assert sd["train[-2shard]"].file_instructions == [fi[-2]]
      assert sd["train[:2shard]"].file_instructions == fi[:2]
      assert sd["train[1shard:]"].file_instructions == fi[1:]
      assert sd["train[-1shard:]"].file_instructions == fi[-1:]
      assert sd["train[1:-1shard]"].file_instructions == fi[1:-1]
  
imports: import functools
  import itertools
  import os
  from unittest import mock
  import tensorflow
  import tensorflow_datasets
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import reader
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import writer
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils import shard_utils
label_desc: Use image node_id 2 for calling a global function with example usage: test_shard_api() without return types