MCPcopy
hub / github.com/dask/dask / call_function

Function call_function

dask/delayed.py:806–826  ·  view source on GitHub ↗
(func, func_token, args, kwargs, pure=None, nout=None)

Source from the content-addressed store, hash-verified

804
805
806def call_function(func, func_token, args, kwargs, pure=None, nout=None):
807 dask_key_name = kwargs.pop("dask_key_name", None)
808 pure = kwargs.pop("pure", pure)
809
810 if dask_key_name is None:
811 name = f"{funcname(func)}-{tokenize(func_token, *args, pure=pure, **kwargs)}"
812 else:
813 name = dask_key_name
814
815 args2, collections = unzip(map(unpack_collections, args), 2)
816 collections = list(concat(collections))
817
818 dask_kwargs, collections2 = unpack_collections(kwargs)
819 collections.extend(collections2)
820 task = Task(name, func, *args2, **dask_kwargs)
821
822 graph = HighLevelGraph.from_collections(
823 name, {name: task}, dependencies=collections
824 )
825 nout = nout if nout is not None else None
826 return Delayed(name, graph, length=nout)
827
828
829class DelayedLeaf(Delayed):

Callers 2

__call__Method · 0.85
__call__Method · 0.85

Calls 9

funcnameFunction · 0.90
unzipFunction · 0.90
TaskClass · 0.90
DelayedClass · 0.85
popMethod · 0.80
from_collectionsMethod · 0.80
tokenizeFunction · 0.70
unpack_collectionsFunction · 0.70
concatFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…