code: def test_sharded_file_template_shard_index():
      builder_dir = epath.Path("/my/path")
      template = naming.ShardedFileTemplate(
          template="data/mnist-train.tfrecord-{SHARD_INDEX}",
          data_dir=builder_dir,
      )
      assert (
          os.fspath(
              template.sharded_filepath(shard_index=12, num_shards=100)
          )
          == "/my/path/data/mnist-train.tfrecord-00012"
      )
      assert (
          os.fspath(template.sharded_filepaths_pattern())
          == "/my/path/data/mnist-train.tfrecord*"
      )
      assert (
          os.fspath(template.sharded_filepaths_pattern(num_shards=100))
          == "/my/path/data/mnist-train.tfrecord@100"
      )
  
imports: import os
  from absl.testing import parameterized
  from etils import epath
  import pytest
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import splits
label_desc: Use image node_id 21 for calling a global function with example usage: test_sharded_file_template_shard_index() without return types