本文整理匯總了Python中LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis.__call__方法的典型用法代碼示例。如果您正苦於以下問題:Python LOTHypothesis.__call__方法的具體用法?Python LOTHypothesis.__call__怎麽用?Python LOTHypothesis.__call__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis
的用法示例。
在下文中一共展示了LOTHypothesis.__call__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *vals):
"""
Must overwrite call in order to include the constants
"""
vals = list(vals)
vals.extend(self.parameters)
return LOTHypothesis.__call__(self, *vals)
示例2: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *vals):
"""
Must overwrite call in order to include the constants
"""
vals = list(vals)
vals.extend(self.CONSTANT_VALUES)
return LOTHypothesis.__call__(self, *vals)
示例3: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *args, **kwargs):
# we have to mod this to insert the spaces since they aren't part of cons above
ret = LOTHypothesis.__call__(self, *args, **kwargs)
out = dict()
for k, v in ret.items():
out[" ".join(k)] = v
return out
示例4: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *args, **kwargs):
if self.value_set is None:
value_set = LOTHypothesis.__call__(self)
# Restrict our concept to being within our domain; also handle 'None' call values
if isinstance(value_set, set):
value_set = [x for x in value_set if x <= self.domain]
else:
value_set = []
self.value_set = value_set
return self.value_set
示例5: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *args, **kwargs):
# Sometimes self.value has too many nodes
try:
value_set = LOTHypothesis.__call__(self)
except TooBigException:
value_set = set()
if isinstance(value_set, set):
# Restrict our concept to being within our domain
value_set = [x for x in value_set if (1 <= x <= self.domain)]
else:
# Sometimes self() returns None
value_set = set()
return value_set
示例6: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *args):
try:
return LOTHypothesis.__call__(self, *args)
except EvaluationException:
return None
示例7: __call__
# 需要導入模塊: from LOTlib.Hypotheses.LOTHypothesis import LOTHypothesis [as 別名]
# 或者: from LOTlib.Hypotheses.LOTHypothesis.LOTHypothesis import __call__ [as 別名]
def __call__(self, *args, **kwargs):
return compute_outcomes(lambda *args: LOTHypothesis.__call__(self, *args, **kwargs), maxcontext=100000)