コード例 #1
0
def list_info_files(dir_path: type_utils.PathLike) -> List[str]:
  """Returns name of info files within dir_path."""
  path = os.fspath(dir_path)
  return [
      fname for fname in tf.io.gfile.listdir(path)
      if not tf.io.gfile.isdir(os.path.join(path, fname)) and
      not file_adapters.is_example_file(fname)
  ]
コード例 #2
0
def list_info_files(dir_path: epath.PathLike) -> List[str]:
  """Returns name of info files within dir_path."""
  from tensorflow_datasets.core import file_adapters  # pylint: disable=g-import-not-at-top  # pytype: disable=import-error
  path = os.fspath(dir_path)
  return [
      fname for fname in tf.io.gfile.listdir(path)
      if not tf.io.gfile.isdir(os.path.join(path, fname)) and
      not file_adapters.is_example_file(fname)
  ]
コード例 #3
0
def test_is_example_file():
    assert file_adapters.is_example_file('example1.tfrecord')
    assert file_adapters.is_example_file('example1.riegeli')
    assert file_adapters.is_example_file('example1.tfrecord-00000-of-00001')
    assert not file_adapters.is_example_file('example1.info')