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

Method register

dask/utils.py:718–729  ·  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

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

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