tools/disable_tests/conditions.py
def evaluate(cond: Condition, true_vars: Set[Terminal]) -> bool:
  """Evaluate a condition with a given set of true variables."""

  if isinstance(cond, BaseCondition):
    return cond is ALWAYS

  if isinstance(cond, Terminal):
    return cond in true_vars

  # => must be a tuple

  op, args = cond
  if op == 'not':
    return not evaluate(args, true_vars)

  return {'or': any, 'and': all}[op](evaluate(arg, true_vars) for arg in args)
Evaluate a condition with a given set of true variables.
Evaluate a condition with a given set of true variables.
Evaluate a condition with a given set of true variables .
def evaluate(cond: Condition, true_vars: Set[Terminal]) -> bool:
  if isinstance(cond, BaseCondition):
    return cond is ALWAYS
  if isinstance(cond, Terminal):
    return cond in true_vars
  op, args = cond
  if op == 'not':
    return not evaluate(args, true_vars)
  return {'or': any, 'and': all}[op](evaluate(arg, true_vars) for arg in args)
def evaluate ( cond : Condition , true_vars : Set [ Terminal ] ) -> bool : if isinstance ( cond , BaseCondition ) : return cond is ALWAYS if isinstance ( cond , Terminal ) : return cond in true_vars op , args = cond if op == 'not' : return not evaluate ( args , true_vars ) return { 'or' : any , 'and' : all } [ op ] ( evaluate ( arg , true_vars ) for arg in args )
Evaluate a condition with a given set of true variables.
Evaluate a condition with a given set of true variables .
"""Evaluate a condition with a given set of true variables.""" # => must be a tuple
cond
Condition
true_vars
Set[Terminal]