MCPcopy
hub / github.com/TensorSpeech/TensorFlowTTS / find_files

Function find_files

tensorflow_tts/utils/utils.py:22–38  ·  view source on GitHub ↗

Find files recursively. Args: root_dir (str): Root root_dir to find. query (str): Query to find. include_root_dir (bool): If False, root_dir name is not included. Returns: list: List of found filenames.

(root_dir, query="*.wav", include_root_dir=True)

Source from the content-addressed store, hash-verified

20
21
22def find_files(root_dir, query="*.wav", include_root_dir=True):
23 """Find files recursively.
24 Args:
25 root_dir (str): Root root_dir to find.
26 query (str): Query to find.
27 include_root_dir (bool): If False, root_dir name is not included.
28 Returns:
29 list: List of found filenames.
30 """
31 files = []
32 for root, _, filenames in os.walk(root_dir, followlinks=True):
33 for filename in fnmatch.filter(filenames, query):
34 files.append(os.path.join(root, filename))
35 if not include_root_dir:
36 files = [file_.replace(root_dir + "/", "") for file_ in files]
37
38 return files
39
40
41def _path_requires_gfile(filepath):

Callers 8

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected