class_docstr: Template to produce filenames for sharded datasets.
  
  Attributes:
    data_dir: the directory that contains the files for the shards.
    template: template of the sharded files, e.g.
      '${SPLIT}/data.${FILEFORMAT}-${SHARD_INDEX}'.
    dataset_name: the name of the dataset.
    split: the split of the dataset.
    filetype_suffix: the filetype suffix to denote the type of file. For
      example, `tfrecord`.
docstr: Returns the regular expression for this template.
  
  Can be used to test whether a filename matches to this template.
docstr_tok: ["Returns","the","regular","expression","for","this","template",".","Can","be","used","to","test","whether","a","filename","matches","to","this","template","."]
code: def regex(self) -> "re.Pattern[str]":
      """Returns the regular expression for this template.
  
      Can be used to test whether a filename matches to this template.
      """
      return re.compile(_filename_template_to_regex(self.template))
  
imports: from __future__ import annotations
  import dataclasses
  import functools
  import os
  import re
  import textwrap
  from typing import Any, Dict, List, Mapping, MutableMapping, Optional, Tuple, Union
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import version
label_desc: Use image node_id 2 for calling the ShardedFileTemplate obj's underlying member method code with example usage: obj.regex() and returns: re