def _solve(entry, child, value, context=None): if context is None: context = {} ent = entry.children[child].entry if child is not None else entry result = solve(ent.value, ent, ExpressionParameters([entry]), context, value) return dict((str(c), v) for c,v in result.items())
def _solve(self, expression, value, context): '''Solve an expression given the result and context. Will throw a bdec.inspect.solver.SolverError if the expression cannot be resolved correctly.''' ref_values = solve(expression, self.entry, self._params, context, value) for ref, ref_value in ref_values.items(): context[ref.name] = ref_value