MCPcopy
hub / github.com/dask/dask / substitute

Method substitute

dask/_task_spec.py:357–366  ·  view source on GitHub ↗
(self, subs: dict, key: KeyType | None = None)

Source from the content-addressed store, hash-verified

355 return TaskRef, (self.key,)
356
357 def substitute(self, subs: dict, key: KeyType | None = None) -> TaskRef | GraphNode:
358 if self.key in subs:
359 val = subs[self.key]
360 if isinstance(val, GraphNode):
361 return val.substitute({}, key=self.key)
362 elif isinstance(val, TaskRef):
363 return val
364 else:
365 return TaskRef(val)
366 return self
367
368
369def _is_dask_future(obj: object) -> bool:

Callers

nothing calls this directly

Calls 2

TaskRefClass · 0.85
substituteMethod · 0.45

Tested by

no test coverage detected