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

Function subs

dask/blockwise.py:196–209  ·  view source on GitHub ↗

Create a new task with the values substituted This is like dask.core.subs, but takes a dict of many substitutions to perform simultaneously. It is not as concerned with micro performance.

(task, substitution)

Source from the content-addressed store, hash-verified

194
195
196def subs(task, substitution):
197 """Create a new task with the values substituted
198
199 This is like dask.core.subs, but takes a dict of many substitutions to
200 perform simultaneously. It is not as concerned with micro performance.
201 """
202 if isinstance(task, dict):
203 return {k: subs(v, substitution) for k, v in task.items()}
204 if type(task) in (tuple, list, set):
205 return type(task)([subs(x, substitution) for x in task])
206 try:
207 return substitution[task]
208 except (KeyError, TypeError):
209 return task
210
211
212def index_subs(ind, substitution):

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected