#NEWLINE# def validate_is_instance( a , cls , message = '' , exception = None ) : #NEWLINE# #INDENT# '\n    Raises an exception if a is not an instance of cls\n    @param a Object\n    @param cls Class\n    @param message Error message to be included with the exception\n    @param Exception, exception module to use in lieu of default\n    @throws BadRequest if conditional is evaluated to False\n    ' #NEWLINE# if ( not isinstance ( a , cls ) ) : #NEWLINE# #INDENT# ( name , l ) = scoped_validation ( ) #NEWLINE# ArgCheck ( name , exception ) . validation ( False , message , l )