#NEWLINE# @ staticmethod #NEWLINE# def _sanitize( assumptions , obj = None ) : #NEWLINE# #INDENT# 'Remove None, covert values to bool, check commutativity *in place*.\n        ' #NEWLINE# is_commutative = fuzzy_bool ( assumptions . get ( 'commutative' , True ) ) #NEWLINE# if ( is_commutative is None ) : #NEWLINE# #INDENT# whose = ( ( '%s ' % obj . __name__ ) if obj else '' ) #NEWLINE# raise ValueError ( ( '%scommutativity must be True or False.' % whose ) ) #NEWLINE# #UNINDENT# for key in list ( assumptions . keys ( ) ) : #NEWLINE# #INDENT# from collections import defaultdict #NEWLINE# from sympy.utilities.exceptions import SymPyDeprecationWarning #NEWLINE# keymap = defaultdict ( ( lambda : None ) ) #NEWLINE# keymap . update ( { #NEWLINE# #INDENT# 'bounded' : 'finite' , #NEWLINE# 'unbounded' : 'infinite' , #NEWLINE# 'infinitesimal' : 'zero' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if keymap [ key ] : #NEWLINE# #INDENT# SymPyDeprecationWarning ( feature = ( '%s assumption' % key ) , useinstead = ( '%s' % keymap [ key ] ) , issue = 8071 , deprecated_since_version = '0.7.6' ) . warn ( ) #NEWLINE# assumptions [ keymap [ key ] ] = assumptions [ key ] #NEWLINE# assumptions . pop ( key ) #NEWLINE# key = keymap [ key ] #NEWLINE# #UNINDENT# v = assumptions [ key ] #NEWLINE# if ( v is None ) : #NEWLINE# #INDENT# assumptions . pop ( key ) #NEWLINE# continue #NEWLINE# #UNINDENT# assumptions [ key ] = bool ( v )