MCPcopy
hub / github.com/dask/dask / register

Method register

dask/utils.py:719–730  ·  view source on GitHub ↗

Register dispatch of `func` on arguments of type `type`

(self, type, func=None)

Source from the content-addressed store, hash-verified

717 self.__name__ = name
718
719 def register(self, type, func=None):
720 """Register dispatch of `func` on arguments of type `type`"""
721
722 def wrapper(func):
723 if isinstance(type, tuple):
724 for t in type:
725 self.register(t, func)
726 else:
727 self._lookup[type] = func
728 return func
729
730 return wrapper(func) if func is not None else wrapper
731
732 def register_lazy(self, toplevel, func=None):
733 """

Callers 15

wrapperMethod · 0.95
test_dispatchFunction · 0.95
test_dispatch_kwargsFunction · 0.95
test_dispatch_lazyFunction · 0.95
getFunction · 0.45
register_xarrayFunction · 0.45
tokenize.pyFile · 0.45
test_registerFunction · 0.45
test_registerFunction · 0.45
test_tokenize_methodFunction · 0.45

Calls 1

wrapperFunction · 0.70

Tested by 9

test_dispatchFunction · 0.76
test_dispatch_kwargsFunction · 0.76
test_dispatch_lazyFunction · 0.76
test_registerFunction · 0.36
test_registerFunction · 0.36
test_tokenize_methodFunction · 0.36
register_decimalFunction · 0.36