<s> """<STR_LIT>""" <EOL> class DjangoRuntimeWarning ( RuntimeWarning ) : <EOL> pass <EOL> class ObjectDoesNotExist ( Exception ) : <EOL> "<STR_LIT>" <EOL> silent_variable_failure = True <EOL> class MultipleObjectsReturned ( Exception ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> class SuspiciousOperation ( Exception ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> class PermissionDenied ( Exception ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> class ViewDoesNotExist ( Exception ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> class MiddlewareNotUsed ( Exception ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> class ImproperlyConfigured ( Exception ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> class FieldError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> NON_FIELD_ERRORS = '<STR_LIT>' <EOL> class ValidationError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message , code = None , params = None ) : <EOL> import operator <EOL> from google . appengine . _internal . django . utils . encoding import force_unicode <EOL> """<STR_LIT>""" <EOL> if isinstance ( message , dict ) : <EOL> self . message_dict = message <EOL> message = reduce ( operator . add , message . values ( ) ) <EOL> if isinstance ( message , list ) : <EOL> self . messages = [ force_unicode ( msg ) for msg in message ] <EOL> else : <EOL> self . code = code <EOL> self . params = params <EOL> message = force_unicode ( message ) <EOL> self . messages = [ message ] <EOL> def __str__ ( self ) : <EOL> if hasattr ( self , '<STR_LIT>' ) : <EOL> return repr ( self . message_dict ) <EOL> return repr ( self . messages ) <EOL> def __repr__ ( self ) : <EOL> if hasattr ( self , '<STR_LIT>' ) : <EOL> return '<STR_LIT>' % repr ( self . message_dict ) <EOL> return '<STR_LIT>' % repr ( self . messages ) <EOL> def update_error_dict ( self , error_dict ) : <EOL> if hasattr ( self , '<STR_LIT>' ) : <EOL> if error_dict : <EOL> for k , v in self . message_dict . items ( ) : <EOL> error_dict . setdefault ( k , [ ] ) . extend ( v ) <EOL> else : <EOL> error_dict = self . message_dict <EOL> else : <EOL> error_dict [ NON_FIELD_ERRORS ] = self . messages <EOL> return error_dict </s>
