def _ask(fact, obj):
 assumptions = obj._assumptions
 handler_map = obj._prop_handler
 assumptions._tell(fact, None)
 try:
  evaluate = handler_map[fact]
 except KeyError:
  pass
 else:
  a = evaluate(obj)
  if (a is not None):
   assumptions.deduce_all_facts(((fact, a),))
   return a
 prereq = list(_assume_rules.prereq[fact])
 shuffle(prereq)
 for pk in prereq:
  if (pk in assumptions):
   continue
  if (pk in handler_map):
   _ask(pk, obj)
   ret_val = assumptions.get(fact)
   if (ret_val is not None):
    return ret_val
 return None

def _ask ( fact , obj ) : assumptions = obj . _assumptions handler_map = obj . _prop_handler assumptions . _tell ( fact , None ) try : evaluate = handler_map [ fact ] except KeyError : pass else : a = evaluate ( obj ) if ( a is not None ) : assumptions . deduce_all_facts ( ( ( fact , a ) , ) ) return a prereq = list ( _assume_rules . prereq [ fact ] ) shuffle ( prereq ) for pk in prereq : if ( pk in assumptions ) : continue if ( pk in handler_map ) : _ask ( pk , obj ) ret_val = assumptions . get ( fact ) if ( ret_val is not None ) : return ret_val return None
find the truth value for a property of an object .