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

Function wrap

dask/array/wrap.py:113–129  ·  view source on GitHub ↗
(wrap_func, func, func_like=None, **kwargs)

Source from the content-addressed store, hash-verified

111
112@curry
113def wrap(wrap_func, func, func_like=None, **kwargs):
114 if func_like is None:
115 f = partial(wrap_func, func, **kwargs)
116 else:
117 f = partial(wrap_func, func_like, **kwargs)
118 template = """
119 Blocked variant of %(name)s
120
121 Follows the signature of %(name)s exactly except that it also features
122 optional keyword arguments ``chunks: int, tuple, or dict`` and ``name: str``.
123
124 Original signature follows below.
125 """
126 if func.__doc__ is not None:
127 f.__doc__ = template % {"name": func.__name__} + func.__doc__
128 f.__name__ = "blocked_" + func.__name__
129 return f
130
131
132w = wrap(wrap_func_shape_as_first_arg)

Callers 1

wrap.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected