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

Function hlg_layer

dask/utils_test.py:141–146  ·  view source on GitHub ↗

Get the first layer from a HighLevelGraph whose name starts with a prefix

(hlg: HighLevelGraph, prefix: str)

Source from the content-addressed store, hash-verified

139
140
141def hlg_layer(hlg: HighLevelGraph, prefix: str) -> Layer:
142 "Get the first layer from a HighLevelGraph whose name starts with a prefix"
143 for key, lyr in hlg.layers.items():
144 if key.startswith(prefix):
145 return lyr
146 raise KeyError(f"No layer starts with {prefix!r}: {list(hlg.layers)}")
147
148
149def hlg_layer_topological(hlg: HighLevelGraph, i: int) -> Layer:

Callers 1

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected