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

Function hlg_layer

dask/utils_test.py:156–161  ·  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

154
155
156def hlg_layer(hlg: HighLevelGraph, prefix: str) -> Layer:
157 "Get the first layer from a HighLevelGraph whose name starts with a prefix"
158 for key, lyr in hlg.layers.items():
159 if key.startswith(prefix):
160 return lyr
161 raise KeyError(f"No layer starts with {prefix!r}: {list(hlg.layers)}")
162
163
164def hlg_layer_topological(hlg: HighLevelGraph, i: int) -> Layer:

Callers 1

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected