#NEWLINE# def compress( self , values ) : #NEWLINE# #INDENT# if ( not values ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# ( lower , upper ) = lower #NEWLINE# if ( ( lower is not None ) and ( upper is not None ) and ( lower > upper ) ) : #NEWLINE# #INDENT# raise exceptions . ValidationError ( self . error_messages [ 'bound_ordering' ] , code = 'bound_ordering' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# range_value = self . range_type ( lower , upper ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# raise exceptions . ValidationError ( self . error_messages [ 'invalid' ] , code = 'invalid' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return range_value