MCPcopy Create free account
hub / github.com/dask/dask / paths_containing_key

Function paths_containing_key

dask/config.py:291–306  ·  view source on GitHub ↗

Generator yielding paths which contain the given key.

(
    key: str,
    paths: Sequence[str] = paths,
)

Source from the content-addressed store, hash-verified

289
290
291def paths_containing_key(
292 key: str,
293 paths: Sequence[str] = paths,
294) -> Iterator[pathlib.Path]:
295 """
296 Generator yielding paths which contain the given key.
297 """
298 # Check existing config files for any which contains this key.
299 for path_ in paths:
300 for path, config in collect_yaml([path_], return_paths=True):
301 try:
302 get(key, config=config)
303 except KeyError:
304 continue
305 else:
306 yield pathlib.Path(path)
307
308
309def ensure_file(

Callers 1

Calls 2

collect_yamlFunction · 0.85
getFunction · 0.70

Tested by 1