MCPcopy Index your code
hub / github.com/dask/dask / clone_value

Method clone_value

dask/highlevelgraph.py:238–258  ·  view source on GitHub ↗

Variant of distributed.utils_comm.subs_multiple, which allows injecting bind_to

(o)

Source from the content-addressed store, hash-verified

236 is_leaf: bool
237
238 def clone_value(o):
239 """Variant of distributed.utils_comm.subs_multiple, which allows injecting
240 bind_to
241 """
242 nonlocal is_leaf
243
244 typ = type(o)
245 if typ is tuple and o and callable(o[0]):
246 return (o[0],) + tuple(clone_value(i) for i in o[1:])
247 elif typ is list:
248 return [clone_value(i) for i in o]
249 elif typ is dict:
250 return {k: clone_value(v) for k, v in o.items()}
251 else:
252 try:
253 if o not in keys:
254 return o
255 except TypeError:
256 return o
257 is_leaf = False
258 return clone_key(o, seed)
259
260 dsk_new = {}
261 bound = False

Callers

nothing calls this directly

Calls 2

clone_keyFunction · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected