<s> """<STR_LIT>""" <EOL> from bson . errors import * <EOL> try : <EOL> from ssl import CertificateError <EOL> except ImportError : <EOL> from pymongo . ssl_match_hostname import CertificateError <EOL> class PyMongoError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class ConnectionFailure ( PyMongoError ) : <EOL> """<STR_LIT>""" <EOL> class AutoReconnect ( ConnectionFailure ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message = '<STR_LIT>' , errors = None ) : <EOL> self . errors = self . details = errors or [ ] <EOL> ConnectionFailure . __init__ ( self , message ) <EOL> class NetworkTimeout ( AutoReconnect ) : <EOL> """<STR_LIT>""" <EOL> class NotMasterError ( AutoReconnect ) : <EOL> """<STR_LIT>""" <EOL> class ServerSelectionTimeoutError ( AutoReconnect ) : <EOL> """<STR_LIT>""" <EOL> class ConfigurationError ( PyMongoError ) : <EOL> """<STR_LIT>""" <EOL> class OperationFailure ( PyMongoError ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , error , code = None , details = None ) : <EOL> self . __code = code <EOL> self . __details = details <EOL> PyMongoError . __init__ ( self , error ) <EOL> @ property <EOL> def code ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __code <EOL> @ property <EOL> def details ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __details <EOL> class CursorNotFound ( OperationFailure ) : <EOL> """<STR_LIT>""" <EOL> class ExecutionTimeout ( OperationFailure ) : <EOL> """<STR_LIT>""" <EOL> class WriteConcernError ( OperationFailure ) : <EOL> """<STR_LIT>""" <EOL> class WriteError ( OperationFailure ) : <EOL> """<STR_LIT>""" <EOL> class WTimeoutError ( WriteConcernError ) : <EOL> """<STR_LIT>""" <EOL> class DuplicateKeyError ( WriteError ) : <EOL> """<STR_LIT>""" <EOL> class BulkWriteError ( OperationFailure ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , results ) : <EOL> OperationFailure . __init__ ( <EOL> self , "<STR_LIT>" , <NUM_LIT> , results ) <EOL> class InvalidOperation ( PyMongoError ) : <EOL> """<STR_LIT>""" <EOL> class InvalidName ( PyMongoError ) : <EOL> """<STR_LIT>""" <EOL> class CollectionInvalid ( PyMongoError ) : <EOL> """<STR_LIT>""" <EOL> class InvalidURI ( ConfigurationError ) : <EOL> """<STR_LIT>""" <EOL> class ExceededMaxWaiters ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class DocumentTooLarge ( InvalidDocument ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
