code: def _get_file_infos(
      filename_template: naming.ShardedFileTemplate,
  ) -> Sequence[naming.FilenameInfo]:
      """Returns the file infos from the files matching the given template."""
      file_infos = []
      for f in filename_template.data_dir.iterdir():
          file_info = filename_template.parse_filename_info(f.name)
          if file_info is not None:
              file_infos.append(file_info)
      if not file_infos:
          raise ValueError(
              f"Could not find data files in {filename_template.data_dir}. "
              f"Make sure to follow the pattern: `{filename_template.template}`"
          )
      return file_infos
  
file_path: datasets/tensorflow_datasets/core/folder_dataset/write_metadata_utils.py
imports: from collections.abc import Sequence
  import os
  from typing import Union
  from etils import epath
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import read_only_builder
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.folder_dataset import compute_split_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _get_file_infos(filename_template) and returns: file_infos