code: def test_sharded_file_template_sharded_filepath_shard_x_of_y():
      builder_dir = epath.Path("/my/path")
      template_explicit = naming.ShardedFileTemplate(
          template="data/mnist-train.tfrecord-{SHARD_INDEX}-of-{NUM_SHARDS}",
          data_dir=builder_dir,
      )
      assert (
          os.fspath(
              template_explicit.sharded_filepath(
                  shard_index=12, num_shards=100
              )
          )
          == "/my/path/data/mnist-train.tfrecord-00012-of-00100"
      )
  
      template = naming.ShardedFileTemplate(
          template="data/mnist-train.tfrecord-{SHARD_X_OF_Y}",
          data_dir=builder_dir,
      )
      assert (
          os.fspath(
              template.sharded_filepath(shard_index=12, num_shards=100)
          )
          == "/my/path/data/mnist-train.tfrecord-00012-of-00100"
      )
  
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 22 for calling a global function with example usage: test_sharded_file_template_sharded_filepath_shard_x_of_y() without return types