MCPcopy
hub / github.com/hyperopt/hyperopt / __call__

Method __call__

hyperopt/pyll/base.py:592–603  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

590 self.expr = expr # pyll graph defining this Lambda
591
592 def __call__(self, *args, **kwargs):
593 # -- return `expr` cloned from given args and kwargs
594 if len(args) > len(self.params):
595 raise TypeError("too many arguments")
596 memo = {}
597 for arg, param in zip(args, self.params):
598 # print('applying with arg', param, arg)
599 memo[param[1]] = as_apply(arg)
600 if len(args) != len(self.params) or kwargs:
601 raise NotImplementedError("named / default arguments", (args, self.params))
602 rval = clone(self.expr, memo)
603 return rval
604
605
606class UndefinedValue:

Callers

nothing calls this directly

Calls 2

as_applyFunction · 0.85
cloneFunction · 0.85

Tested by

no test coverage detected