def check_assumptions(expr, against=None, **assumptions):
 if (against is not None):
  assumptions = against.assumptions0
 expr = sympify(expr)
 result = True
 for (key, expected) in assumptions.items():
  if (expected is None):
   continue
  test = getattr(expr, ('is_' + key), None)
  if (test is expected):
   continue
  elif (test is not None):
   return False
  result = None
 return result

def check_assumptions ( expr , against = None , ** assumptions ) : if ( against is not None ) : assumptions = against . assumptions0 expr = sympify ( expr ) result = True for ( key , expected ) in assumptions . items ( ) : if ( expected is None ) : continue test = getattr ( expr , ( 'is_' + key ) , None ) if ( test is expected ) : continue elif ( test is not None ) : return False result = None return result
checks whether expression expr satisfies all assumptions .