U
    @f{                  %   @   s  d Z ddlZddlZddlmZ ddlmZ ddlmZm	Z	 ddl
mZmZmZmZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ zddl,m-Z- ee-fZ.W n e/k
r,   efZ.Y nX erBddl0m1Z1 nddl2m1Z1 dZ3de3 Z4dZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAd ZBdZCdZDdZEdZFd!ZGd"ZHd"ZId#ZJd$ZKd%ZLd&d' ZMd(d) ZNd*d+ ZOejPejQejRejSejTd,ZUd-d. ZVd/d0 ZWd1d2 ZXd3d4 ZYd5d6 ZZd7d8 Z[d9d: Z\d;d< Z]d=d> Z^d?d@ Z_dAdB Z`dCdD ZadEdF ZbdGdH ZcdIdJ ZddKdL ZedMdN ZfdOdP ZgdQdR ZhdSdT ZidUdV ZjdWdX ZkdYdZ Zlemd[d\d]d^gZnd_d` Zodadb Zpdcdd Zqdedf Zrdgdh Zsdidj Ztdkdl Zudmdn Zvdodp Zwdqdr Zxdsdt Zydudv Zzdwdx Z{dydz Z|emd{d|d}gZ}d~d Z~dd Zdgdgdgdgdgdgdgdgdgd	Zewejeoe^eefeWedeWecede\ege_eiele_eWeWeWeeefe[eWe(e'dd eWe[e[e_dd eWeaeZed$ZeWexeyeWeZeWe[eWe~eke]eddZepeqehe ee_e_ezed	Zddddddddddd
Zddddddddddd
Zee eeD ],\ZZeD ]ZeekrJee ee< qJq>e Zee dddddddgZemdgZdd Zdd ZdddZemddddddgZG dd deZG dd dejZdS )z9Functions and classes common to multiple pymongo modules.    N)SON)UuidRepresentation)CodecOptionsTypeRegistry)abcinteger_types	iteritemsstring_typePY3)RawBSONDocument)
MECHANISMS)validate_compressorsvalidate_zlib_compression_level)
DriverInfo)	ServerApi)%validate_auto_encryption_opts_or_noneConfigurationError)_validate_event_listeners)ReadConcern)_MONGOS_MODES_ServerMode)validate_cert_reqsvalidate_allow_invalid_certs)DEFAULT_WRITE_CONCERNWriteConcern)OrderedDict)unquote_plusi      i  z2.6   
         g      ?<   g      4@d      T);   )r   i@  i@  i'  c                 C   sZ   | }d}|  d}|dkr<| d| t| |d d  }}|drR|dd }||fS )z5Split a host:port string into (host, int(port)) pair.ii  :Nr!   [)rfindint
startswith)nodehostportidx r1   2/tmp/pip-unpacked-wheel-gs_301nf/pymongo/common.pypartition_nodez   s    
"
r3   c                 C   s   t | \}}| |fS )z6Split and normalize a node name from a hello response.)r3   lower)r-   r.   r/   r1   r1   r2   
clean_node   s    r5   c                 C   s   t d| f dS )z1Raise ConfigurationError with the given key name.zUnknown option %sNr   )keydummyr1   r1   r2   raise_config_error   s    r8   )unspecifiedstandardZpythonLegacyZ
javaLegacyZcsharpLegacyc                 C   s    t |tr|S td| f dS )z(Validates that 'value' is True or False.z%s must be True or FalseN)
isinstancebool	TypeErroroptionvaluer1   r1   r2   validate_boolean   s    
rA   c                 C   s2   t |tr(|dkr td| f |dkS t| |S )z8Validates that value is True, False, 'true', or 'false'.)truefalsez)The value of %s must be 'true' or 'false'rB   )r;   r	   
ValueErrorrA   r>   r1   r1   r2   validate_boolean_or_string   s    
rE   c                 C   sX   t |tr|S t |trFz
t|W S  tk
rD   td| f Y nX td| f dS )zIValidates that 'value' is an integer (or basestring representation).
    z"The value of %s must be an integerz+Wrong type for %s, value must be an integerNr;   r   r	   r+   rD   r=   r>   r1   r1   r2   validate_integer   s    


rG   c                 C   s$   t | |}|dkr td| f |S )zKValidate that 'value' is a positive integer, which does not include 0.
    r   z*The value of %s must be a positive integerrG   rD   r?   r@   valr1   r1   r2   validate_positive_integer   s    
rK   c                 C   s$   t | |}|dk r td| f |S )z6Validate that 'value' is a positive integer or 0.
    r   z.The value of %s must be a non negative integerrH   rI   r1   r1   r2   validate_non_negative_integer   s    
rL   c                 C   s(   |dkr|S t | |}t|d  |S )z6Validates that 'value' is file-like and readable.
    Nr)validate_stringopencloser>   r1   r1   r2   validate_readable   s
    
rQ   c                 C   s   |dkr|S t | |S )z9Validate that 'value' is a positive integer or None.
    NrK   r>   r1   r1   r2   !validate_positive_integer_or_none   s    rS   c                 C   s   |dkr|S t | |S )z>Validate that 'value' is a positive integer or 0 or None.
    N)rL   r>   r1   r1   r2   %validate_non_negative_integer_or_none   s    rT   c                 C   s$   t |tr|S td| tjf dS )zbValidates that 'value' is an instance of `basestring` for Python 2
    or `str` for Python 3.
    z2Wrong type for %s, value must be an instance of %sN)r;   r	   r=   __name__r>   r1   r1   r2   rN      s
    
rN   c                 C   s   |dkr|S t | |S )zEValidates that 'value' is an instance of `basestring` or `None`.
    N)rN   r>   r1   r1   r2   validate_string_or_none   s    rV   c                 C   sN   t |tr|S t |tr<z
t|W S  tk
r:   | Y S X td| f dS )4Validates that 'value' is an integer or string.
    z7Wrong type for %s, value must be an integer or a stringNrF   r>   r1   r1   r2   validate_int_or_basestring  s    



rX   c                 C   sZ   t |tr|S t |trHzt|}W n tk
r<   | Y S X t| |S td| f dS )rW   zDWrong type for %s, value must be an non negative integer or a stringN)r;   r   r	   r+   rD   rL   r=   rI   r1   r1   r2   'validate_non_negative_int_or_basestring  s    



rY   c                 C   sv   d| f }zt |}W n6 tk
r2   t|Y n tk
rL   t|Y nX d|  k rbdk srn td| f |S )z[Validates that 'value' is a float, or can be converted to one, and is
       positive.
    z%s must be an integer or floatr   g    eAz3%s must be greater than 0 and less than one billion)floatrD   r=   )r?   r@   errmsgr1   r1   r2   validate_positive_float  s    
r\   c                 C   s   |dks|dkrdS t | |S )zgValidates that 'value' is 0 or a positive float, or can be converted to
    0 or a positive float.
    r   0r\   r>   r1   r1   r2   validate_positive_float_or_zero2  s    r_   c                 C   s   |dkr|S t | |d S )zcValidates a timeout specified in milliseconds returning
    a value in floating point seconds.
    N     @@r^   r>   r1   r1   r2   validate_timeout_or_none;  s    ra   c                 C   s8   |dkrt d| f |dks&|dkr*dS t| |d S )zValidates a timeout specified in milliseconds returning
    a value in floating point seconds for the case where None is an error
    and 0 is valid. Setting the timeout to nothing in the URI string is a
    config error.
    Nz%s cannot be Noner   r]   r`   )r   r\   r>   r1   r1   r2   validate_timeout_or_zeroD  s
    rb   c                 C   s*   |dks|dks|dkrdS t | |d S )zValidates a timeout specified in milliseconds returning
    a value in floating point seconds. value=0 and value="0" are treated the
    same as value=None which means unlimited timeout.
    Nr   r]   r`   r^   r>   r1   r1   r2    validate_timeout_or_none_or_zeroQ  s    rc   c                 C   s   |dks|dkrdS t | |S )zBValidates maxStalenessSeconds according to the Max Staleness Spec.r(   z-1rR   r>   r1   r1   r2   validate_max_staleness[  s    rd   c                 C   s   t |tstd|f |S )z Validate a read preference.
    z%r is not a read preference.)r;   r   r=   r7   r@   r1   r1   r2   validate_read_preferencec  s    
rf   c                 C   s   |t krtd|f |S )zValidate read preference mode for a MongoReplicaSetClient.

    .. versionchanged:: 3.5
       Returns the original ``value`` instead of the validated read preference
       mode.
    z!%s is not a valid read preference)r   rD   re   r1   r1   r2   validate_read_preference_modek  s    rg   c                 C   s(   |t kr$|dkr$td| tt f |S )z+Validate the authMechanism URI option.
    zCRAM-MD5z%s must be in %s)r   rD   tupler>   r1   r1   r2   validate_auth_mechanismw  s    ri   c                 C   s8   z
t | W S  tk
r2   td|tt f Y nX dS )zAValidate the uuid representation option selected in the URI.
    z7%s is an invalid UUID representation. Must be one of %sN)_UUID_REPRESENTATIONSKeyErrorrD   rh   re   r1   r1   r2   validate_uuid_representation  s    

rl   c              	   C   s   t |ts|g}g }|D ]~}|dkr0|i  qz@i }|dD ]"}|d\}}t||t|< q@|| W q tk
r   td|| f Y qX q|S )z:Parse readPreferenceTags if passed as a client kwarg.
     ,r'   z%r not a valid value for %s)r;   listappendsplitr   	ExceptionrD   )namer@   Ztag_setsZtag_settagstagr6   rJ   r1   r1   r2   validate_read_preference_tags  s$    

rv   ZSERVICE_NAMECANONICALIZE_HOST_NAMEZSERVICE_REALMAWS_SESSION_TOKENc              	   C   s   t | |}i }|dD ]}z|d\}}W n. tk
r\   d|krJd}td|f Y nX |tkrztd|ttf |dkrt||||< qt|||< q|S )z!Validate authMechanismProperties.rn   r'   rx   z_AWS_SESSION_TOKEN:<redacted token>, did you forget to percent-escape the token with quote_plus?zTauth mechanism properties must be key:value pairs like SERVICE_NAME:mongodb, not %s.zA%s is not a supported auth mechanism property. Must be one of %s.rw   )rN   rq   rD   _MECHANISM_PROPSrh   rE   r   )r?   r@   propsoptr6   rJ   r1   r1   r2   "validate_auth_mechanism_properties  s&    

r|   c                 C   s"   t |tjtfstd| f |S )z#Validate the document_class option.zh%s must be dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a sublass of collections.MutableMapping)
issubclassr   MutableMappingr   r=   r>   r1   r1   r2   validate_document_class  s
    r   c                 C   s&   |dk	r"t |ts"td| tf |S )z"Validate the type_registry option.Nz%s must be an instance of %s)r;   r   r=   r>   r1   r1   r2   validate_type_registry  s     r   c                 C   s   t |tstd| f |S )z!Validates that 'value' is a list.z%s must be a list)r;   ro   r=   r>   r1   r1   r2   validate_list  s    
r   c                 C   s   |dkr|S t | |S )z)Validates that 'value' is a list or None.N)r   r>   r1   r1   r2   validate_list_or_none  s    r   c                 C   s"   t |tjtfstd| f dS )z/Validates that 'value' is a list or a document.zw%s must either be a list or an instance of dict, bson.son.SON, or any other type that inherits from collections.MappingN)r;   r   Mappingro   r=   r>   r1   r1   r2   validate_list_or_mapping  s    r   c                 C   s   t |tjstd| f dS )z=Validate the type of method arguments that expect a document.zf%s must be an instance of dict, bson.son.SON, or any other type that inherits from collections.MappingN)r;   r   r   r=   r>   r1   r1   r2   validate_is_mapping  s    r   c                 C   s"   t |tjtfstd| f dS )zEValidate the type of method arguments that expect a MongoDB document.z%s must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMappingN)r;   r   r~   r   r=   r>   r1   r1   r2   validate_is_document_type  s    r   c                 C   s:   |dkr|S t | | t|ddkr6td| f |S )zValidate the appname option.Nzutf-8   z%s must be <= 128 bytes)rN   lenencoderD   r>   r1   r1   r2   validate_appname_or_none  s    
r   c                 C   s(   |dkr|S t |ts$td| f |S )z Validate the driver keyword arg.Nz$%s must be an instance of DriverInfo)r;   r   r=   r>   r1   r1   r2   validate_driver_or_none  s
    
r   c                 C   s(   |dkr|S t |ts$td| f |S )z$Validate the server_api keyword arg.Nz#%s must be an instance of ServerApi)r;   r   r=   r>   r1   r1   r2   validate_server_api_or_none  s
    
r   c                 C   s&   |dkr|S t |s"td| f |S )z%Validates that 'value' is a callable.Nz%s must be a callable)callablerD   r>   r1   r1   r2   validate_is_callable_or_none  s
    r   c                 C   s:   t d|  | r6t| ts6tt| }|dr6tddS )z Validate a replacement document.replacement$z'replacement can not include $ operatorsN)r   r;   r   nextiterr,   rD   )r   firstr1   r1   r2   validate_ok_for_replace#  s
    

r   c                 C   sH   t d|  | stdt| t }tt| }|rD|dsDtddS )zValidate an update document.updatezupdate cannot be emptyr   z"update only works with $ operatorsN)r   rD   r;   ro   r   r   r,   )r   Zis_documentr   r1   r1   r2   validate_ok_for_update-  s    
r   strictreplaceignorec                 C   s    |t krtd|tt f |S )zFValidate the Unicode decode error handler option of CodecOptions.
    z@%s is an invalid Unicode decode error handler. Must be one of %s)_UNICODE_DECODE_ERROR_HANDLERSrD   rh   re   r1   r1   r2   %validate_unicode_decode_error_handler=  s
    
r   c                 C   s$   |dk	r t |tjs td| |S )zValidate the tzinfo option
    Nz)%s must be an instance of datetime.tzinfo)r;   datetimetzinfor=   re   r1   r1   r2   validate_tzinfoG  s    r   jwtimeoutsslssl_cert_reqsssl_match_hostnamessl_crlfilessl_ca_certsssl_certfilessl_pem_passphrase)	journal
wtimeoutmstlstlsallowinvalidcertificatestlsallowinvalidhostnames
tlscrlfile	tlscafiletlscertificatekeyfiletlscertificatekeyfilepasswordc                  G   s
   t |   S NrE   xr1   r1   r2   <lambda>~      r   c                  G   s
   t |   S r   r   r   r1   r1   r2   r     r   )$appnameZauthmechanismauthmechanismpropertiesZ
authsourceZcompressorsconnecttimeoutmsZdirectconnectionheartbeatfrequencymsr   ZlocalthresholdmsmaxidletimemsZmaxpoolsizemaxstalenesssecondsZreadconcernlevelZreadpreferenceZreadpreferencetagsZ
replicasetZ
retryreadsZretrywritesZloadbalancedserverselectiontimeoutmssockettimeoutmsssl_keyfiler   r   r   r   r   r   r   r   tlsdisableocspendpointcheckZtlsinsecurewr   Zzlibcompressionlevel)connectZdriverZ
server_apifsyncZminpoolsizeZsocketkeepaliver   Ztz_awareZunicode_decode_error_handlerZuuidrepresentationwaitqueuemultiplewaitqueuetimeoutms)	Zdocument_classZtype_registryread_preferenceZevent_listenersr   usernamepasswordZserver_selectorZauto_encryption_optsr   r   Zssl_check_ocsp_endpoint)
r   r   r   r   r   r   r   r   r   r   )renamedr   )r   Z
wTimeoutMS)r   ZtlsAllowInvalidCertificates)r   ZtlsAllowInvalidHostnames)r   Z
tlsCRLFile)r   Z	tlsCAFile)removedzInstead of using ssl_certfile to specify the certificate file, use tlsCertificateKeyFile to pass a single file containing both the client certificate and the private key)r   zInstead of using ssl_keyfile to specify the private keyfile, use tlsCertificateKeyFile to pass a single file containing both the client certificate and the private key)r   ZtlsCertificateKeyFilePassword)r   zqInstead of using waitQueueMultiple to bound queuing, limit the size of the thread pool in your application server)
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                 C   s,   t | |\}}|tkr$td| f | |fS )z1Validate optional authentication parameters.
    z!Unknown authentication option: %s)validate_AUTH_OPTIONSr   )r?   r@   r4   r1   r1   r2   validate_auth_option  s    r   c                 C   s&   |   }t|t}|| |}| |fS )z!Generic validation function.
    )r4   
VALIDATORSgetr8   )r?   r@   r4   	validatorr1   r1   r2   r     s    
r   c           
         s   t  tr&t }dd } fdd}ni }dd }dd }t D ]v\}}||}zt|t}|||}W n> tttfk
r }	 z|rt	
t|	 n W 5 d}	~	X Y qBX ||||< qB|S )a  Validate each entry in options and raise a warning if it is not valid.
    Returns a copy of options with invalid entries removed.

    :Parameters:
        - `opts`: A dict containing MongoDB URI options.
        - `warn` (optional): If ``True`` then warnings will be logged and
          invalid options will be ignored. Otherwise, invalid options will
          cause errors.
    c                 S   s   | S r   r1   r   r1   r1   r2   r     r   z'get_validated_options.<locals>.<lambda>c                    s
     | S r   )	cased_keyr   optionsr1   r2   r     r   c                 S   s   |   S r   )r4   r   r1   r1   r2   r     r   c                 S   s   | S r   r1   r   r1   r1   r2   r     r   N)r;   _CaseInsensitiveDictionaryr   URI_OPTIONS_VALIDATOR_MAPr   r8   rD   r=   r   warningswarnstr)
r   r   Zvalidated_optionsZget_normed_keyZget_setter_keyr{   r@   Z
normed_keyr   excr1   r   r2   get_validated_options  s*    

 r   r   r   c                   @   sX   e Zd ZdZdd Zedd Zedd Zdd	 Zed
d Z	dd Z
edd ZdS )
BaseObjectzA base class that provides attributes and methods common
    to multiple pymongo classes.

    SHOULD NOT BE USED BY DEVELOPERS EXTERNAL TO MONGODB.
    c                 C   sj   t |tstd|| _t |ts0td|f || _t |tsHtd|| _t |ts`td|| _	d S )NzDcodec_options must be an instance of bson.codec_options.CodecOptionszT%r is not valid for read_preference. See pymongo.read_preferences for valid options.zGwrite_concern must be an instance of pymongo.write_concern.WriteConcernzDread_concern must be an instance of pymongo.read_concern.ReadConcern)
r;   r   r=   _BaseObject__codec_optionsr   _BaseObject__read_preferencer   _BaseObject__write_concernr   _BaseObject__read_concern)selfcodec_optionsr   write_concernread_concernr1   r1   r2   __init__=  s    



zBaseObject.__init__c                 C   s   | j S )zdRead only access to the :class:`~bson.codec_options.CodecOptions`
        of this instance.
        )r   r   r1   r1   r2   r   U  s    zBaseObject.codec_optionsc                 C   s   | j S )zRead only access to the :class:`~pymongo.write_concern.WriteConcern`
        of this instance.

        .. versionchanged:: 3.0
          The :attr:`write_concern` attribute is now read only.
        )r   r   r1   r1   r2   r   \  s    zBaseObject.write_concernc                 C   s   |r|j rtS | jS )zKRead only access to the write concern of this instance or session.
        )Zin_transactionr   r   r   sessionr1   r1   r2   _write_concern_forf  s    
zBaseObject._write_concern_forc                 C   s   | j S )zRead only access to the read preference of this instance.

        .. versionchanged:: 3.0
          The :attr:`read_preference` attribute is now read only.
        )r   r   r1   r1   r2   r   n  s    zBaseObject.read_preferencec                 C   s   |r|  p| jS | jS )zMRead only access to the read preference of this instance or session.
        )Z_txn_read_preferencer   r   r1   r1   r2   _read_preference_forw  s    zBaseObject._read_preference_forc                 C   s   | j S )zRead only access to the :class:`~pymongo.read_concern.ReadConcern`
        of this instance.

        .. versionadded:: 3.2
        )r   r   r1   r1   r2   r     s    zBaseObject.read_concernN)rU   
__module____qualname____doc__r   propertyr   r   r   r   r   r   r1   r1   r1   r2   r   6  s   

	
r   c                   @   s   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zd"ddZdd Zdd Zdd Zd#ddZdd Zd d! ZdS )$r   c                 O   s    i | _ i | _| t|| d S r   )%_CaseInsensitiveDictionary__casedkeys _CaseInsensitiveDictionary__datar   dict)r   argskwargsr1   r1   r2   r     s    z#_CaseInsensitiveDictionary.__init__c                 C   s   |  | jkS r   )r4   r   r   r6   r1   r1   r2   __contains__  s    z'_CaseInsensitiveDictionary.__contains__c                 C   s
   t | jS r   )r   r   r   r1   r1   r2   __len__  s    z"_CaseInsensitiveDictionary.__len__c                 C   s   dd | j D S )Nc                 s   s   | ]
}|V  qd S r   r1   ).0r6   r1   r1   r2   	<genexpr>  s     z6_CaseInsensitiveDictionary.__iter__.<locals>.<genexpr>)r   r   r1   r1   r2   __iter__  s    z#_CaseInsensitiveDictionary.__iter__c                    s   t  fdd D S )Nc                    s   i | ]} j |  j| qS r1   )r   r   )r   kr   r1   r2   
<dictcomp>  s      z7_CaseInsensitiveDictionary.__repr__.<locals>.<dictcomp>)r   r   r1   r   r2   __repr__  s    z#_CaseInsensitiveDictionary.__repr__c                 C   s    |  }|| j|< || j|< d S r   r4   r   r   )r   r6   r@   lc_keyr1   r1   r2   __setitem__  s    
z&_CaseInsensitiveDictionary.__setitem__c                 C   s   | j |  S r   )r   r4   r   r1   r1   r2   __getitem__  s    z&_CaseInsensitiveDictionary.__getitem__c                 C   s   |  }| j|= | j|= d S r   r   )r   r6   r   r1   r1   r2   __delitem__  s    z&_CaseInsensitiveDictionary.__delitem__c                 C   sH   t |tjstS t| t|kr$dS |D ]}| | || kr( dS q(dS )NFT)r;   r   r   NotImplementedr   r   otherr6   r1   r1   r2   __eq__  s    z!_CaseInsensitiveDictionary.__eq__Nc                 C   s   | j | |S r   )r   r   r4   )r   r6   defaultr1   r1   r2   r     s    z_CaseInsensitiveDictionary.getc                 O   s*   |  }| j|d  | jj|f||S r   )r4   r   popr   )r   r6   r   r   r   r1   r1   r2   r    s    z_CaseInsensitiveDictionary.popc                 C   s"   | j  \}}| j|}||fS r   )r   popitemr   r  )r   r   r   r@   r1   r1   r2   r    s    z"_CaseInsensitiveDictionary.popitemc                 C   s   | j   | j  d S r   )r   clearr   r   r1   r1   r2   r    s    
z _CaseInsensitiveDictionary.clearc                 C   s6   |  }|| kr| j| S || j|< || j|< |S d S r   )r4   r   r   )r   r6   r  r   r1   r1   r2   
setdefault  s    


z%_CaseInsensitiveDictionary.setdefaultc                 C   sB   t |tr(|D ]}|| | ||< qn|D ]}|| | |< q,d S r   )r;   r   r   r  r1   r1   r2   r     s
    
z!_CaseInsensitiveDictionary.updatec                 C   s   | j |  S r   )r   r4   r   r1   r1   r2   r     s    z$_CaseInsensitiveDictionary.cased_key)N)N)rU   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r  r	  r   r   r1   r1   r1   r2   r     s    

	r   )T)r   r   r   Zbsonr   Zbson.binaryr   Zbson.codec_optionsr   r   Zbson.py3compatr   r   r   r	   r
   Zbson.raw_bsonr   Zpymongo.authr   Zpymongo.compression_supportr   r   Zpymongo.driver_infor   Zpymongo.server_apir   Zpymongo.encryption_optionsr   Zpymongo.errorsr   Zpymongo.monitoringr   Zpymongo.read_concernr   Zpymongo.read_preferencesr   r   Zpymongo.ssl_supportr   r   Zpymongo.write_concernr   r   collectionsr   ZORDERED_TYPESImportErrorurllib.parser   urllibZMAX_BSON_SIZEZMAX_MESSAGE_SIZEZMIN_WIRE_VERSIONZMAX_WIRE_VERSIONZMAX_WRITE_BATCH_SIZEZMIN_SUPPORTED_SERVER_VERSIONZMIN_SUPPORTED_WIRE_VERSIONZMAX_SUPPORTED_WIRE_VERSIONZHEARTBEAT_FREQUENCYZKILL_CURSOR_FREQUENCYZEVENTS_QUEUE_FREQUENCYZSERVER_SELECTION_TIMEOUTZMIN_HEARTBEAT_INTERVALZMIN_SRV_RESCAN_INTERVALZCONNECT_TIMEOUTZMAX_POOL_SIZEZMIN_POOL_SIZEZMAX_IDLE_TIME_MSZMAX_IDLE_TIME_SECZWAIT_QUEUE_TIMEOUTZLOCAL_THRESHOLD_MSZRETRY_WRITESZRETRY_READSZCOMMAND_NOT_FOUND_CODESZUNAUTHORIZED_CODESZ_MAX_END_SESSIONSr3   r5   r8   ZUNSPECIFIEDZSTANDARDZPYTHON_LEGACYZJAVA_LEGACYZCSHARP_LEGACYrj   rA   rE   rG   rK   rL   rQ   rS   rT   rN   rV   rX   rY   r\   r_   ra   rb   rc   rd   rf   rg   ri   rl   rv   	frozensetry   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZURI_OPTIONS_ALIAS_MAPr   ZNONSPEC_OPTIONS_VALIDATOR_MAPZKW_VALIDATORSZINTERNAL_URI_OPTION_NAME_MAPZURI_OPTIONS_DEPRECATION_MAPr   optnamealiasesaliascopyr   ZTIMEOUT_OPTIONSr   r   r   r   ZWRITE_CONCERN_OPTIONSobjectr   r~   r   r1   r1   r1   r2   <module>   s  	



		
					

,




	
$
S