MCPcopy
hub / github.com/hyperopt/hyperopt / define

Method define

hyperopt/pyll/base.py:123–128  ·  view source on GitHub ↗

Decorator for adding python functions to self

(self, f, o_len=None, pure=False)

Source from the content-addressed store, hash-verified

121 return f
122
123 def define(self, f, o_len=None, pure=False):
124 """Decorator for adding python functions to self"""
125 name = f.__name__
126 if hasattr(self, name):
127 raise ValueError("Cannot override existing symbol", name)
128 return self._define(f, o_len, pure)
129
130 def define_if_new(self, f, o_len=None, pure=False):
131 """Pass silently if f matches the current implementation

Callers 4

define_pureMethod · 0.95
wrapperMethod · 0.95
partialFunction · 0.80
test_recursionFunction · 0.80

Calls 1

_defineMethod · 0.95

Tested by 1

test_recursionFunction · 0.64