code: def test_filename_info_with_custom_template():
      template = _FILENAME_TEMPLATE_CUSTOM_FULL
      filename = "test.00042"
      file_info = naming.FilenameInfo.from_str(
          filename, filename_template=template
      )
      assert str(file_info) == filename
      assert file_info.dataset_name == "mnist"
      assert file_info.split == "test"
      assert file_info.filetype_suffix == "tfrecord"
      assert file_info.shard_index == 42
      assert file_info.num_shards is None
      # This is not valid because the template is for the train split
      assert not naming.FilenameInfo.is_valid(
          filename, filename_template=template
      )
      assert naming.FilenameInfo.is_valid(
          filename, filename_template=template.replace(split="test")
      )
  
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 9 for calling a global function with example usage: test_filename_info_with_custom_template() without return types