#NEWLINE# def multipleOf( validator , dB , instance , schema ) : #NEWLINE# #INDENT# if ( not validator . is_type ( instance , 'number' ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if isinstance ( dB , float ) : #NEWLINE# #INDENT# quotient = ( instance / dB ) #NEWLINE# failed = ( int ( quotient ) != quotient ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# failed = ( instance % dB ) #NEWLINE# #UNINDENT# if failed : #NEWLINE# #INDENT# ( yield ValidationError ( ( '%r is not a multiple of %r' % ( instance , dB ) ) ) )