
    h7                        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"m#Z# ddl$m%Z%m&Z& ddl'm(Z(m)Z) 	 ddl*m+Z+ ee+fZ,erddl.m/Z/ nddl0m/Z/ dZ1de1z  Z2dZ3d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' ZMej                  ej                  ej                  ej                  ej                  d(ZSd) ZTd* ZUd+ ZVd, ZWd- ZXd. ZYd/ ZZd0 Z[d1 Z\d2 Z]d3 Z^d4 Z_d5 Z`d6 Zad7 Zbd8 Zcd9 Zdd: Zed; Zfd< Zgd= Zhd> Zid? Zj ekg d@      ZldA ZmdB ZndC ZodD ZpdE ZqdF ZrdG ZsdH ZtdI ZudJ ZvdK ZwdL ZxdM Zy ekg dN      ZzdO Z{dP Z|dQgdRgdSgdTgdUgdVgdWgdXgdYgdZ	Z}i d[eud\ehd]emd^e\d_ed`eddaeUdbebdceUddeadeebdfeZdgeedhe]diegdjejdke]i dleUdmeUdnecdoeddpeYdqeUdre&dTe%dsdt dUeUdueYdveYdwe]dxeUdyeUdze_d{eXd|eiZ~eUeveUeXeUeYeUe{eie[ebd}Zeneoefee|e]e]ewed~	Zdcd{dSdTdUdVdWdXdYdd
ZdddddddddZe~j                  e        ee}      D ]  \  ZZeD ]  Zee~vse~e   e~e<     e~j                         Zej                  e       g dZ ekd]g      Zd Zd ZddZ ekg d      Z G d de      Z G d dej"                        Zy# e-$ r efZ,Y lw xY w)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)%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);   )   i@  i@  i'  c                     | }d}| j                  d      }|dk7  r| d| t        | |dz   d       }}|j                  d      r|dd }||fS )z5Split a host:port string into (host, int(port)) pair.ii  :Nr!   [)rfindint
startswith)nodehostportidxs       Q/var/www/html/ranktracker/api/venv/lib/python3.12/site-packages/pymongo/common.pypartition_noder4   y   s_    DD
**S/C
by$3ZT#'(^!4dsAbz:    c                 B    t        |       \  }}|j                         |fS )z:Split and normalize a node name from an ismaster response.)r4   lower)r/   r0   r1   s      r3   
clean_noder8      s#    %JD$ ::<r5   c                     t        d|       )z1Raise ConfigurationError with the given key name.zUnknown option r   )keydummys     r3   raise_config_errorr<      s    
C9
::r5   )unspecifiedstandardpythonLegacy
javaLegacycsharpLegacyc                 B    t        |t              r|S t        | d      )z(Validates that 'value' is True or False.z must be True or False)
isinstancebool	TypeErroroptionvalues     r3   validate_booleanrI      s    %
&:
;;r5   c                 j    t        |t              r|dvrt        d| d      |dk(  S t        | |      S )z8Validates that value is True, False, 'true', or 'false'.)truefalseThe value of z must be 'true' or 'false'rK   )rC   r
   
ValueErrorrI   rF   s     r3   validate_boolean_or_stringrO      sA    %%))4:= > >FE**r5   c                     t        |t              r|S t        |t              r	 t        |      S t        d| d      # t        $ r t	        d| d      w xY w)zIValidates that 'value' is an integer (or basestring representation).
    rM   z must be an integerWrong type for z, value must be an integerrC   r   r
   r-   rN   rE   rF   s     r3   validate_integerrS      sb     %'	E;	'	7u: VM
NN  	7-36 7 7	7s	   
> Ac                 F    t        | |      }|dk  rt        d| d      |S )zKValidate that 'value' is a positive integer, which does not include 0.
    r   rM   z must be a positive integerrS   rN   rG   rH   vals      r3   validate_positive_integerrX      s1     65
)C
ax17: ; 	;Jr5   c                 F    t        | |      }|dk  rt        d| d      |S )z6Validate that 'value' is a positive integer or 0.
    r   rM   z must be a non negative integerrU   rV   s      r3   validate_non_negative_integerrZ      s1     65
)C
Qw5;> ? 	?Jr5   c                 Z    ||S t        | |      }t        |d      j                          |S )z6Validates that 'value' is file-like and readable.
    r)validate_stringopencloserF   s     r3   validate_readabler`      s4     } FE*ELr5   c                 "    ||S t        | |      S )z9Validate that 'value' is a positive integer or None.
    rX   rF   s     r3   !validate_positive_integer_or_nonerc      s     }$VU33r5   c                 "    ||S t        | |      S )z>Validate that 'value' is a positive integer or 0 or None.
    )rZ   rF   s     r3   %validate_non_negative_integer_or_nonere      s     }(77r5   c                 d    t        |t              r|S t        d| dt        j                        )zbValidates that 'value' is an instance of `basestring` for Python 2
    or `str` for Python 3.
    rQ   z, value must be an instance of )rC   r
   rE   __name__rF   s     r3   r]   r]      s3     %%
+1;3G3GI J Jr5   c                 "    ||S t        | |      S )zEValidates that 'value' is an instance of `basestring` or `None`.
    )r]   rF   s     r3   validate_string_or_noneri      s     }65))r5   c                     t        |t              r|S t        |t              r	 t        |      S t        d| d      # t        $ r |cY S w xY w)4Validates that 'value' is an integer or string.
    rQ   z&, value must be an integer or a stringrR   rF   s     r3   validate_int_or_basestringrl      sY     %'	E;	'	u: -36 7 7  	L	s   
> AAc                     t        |t              r|S t        |t              r	 t        |      }t        | |      S t        d| d      # t        $ r |cY S w xY w)rk   rQ   z3, value must be an non negative integer or a string)rC   r   r
   r-   rN   rZ   rE   rV   s      r3   'validate_non_negative_int_or_basestringrn     sh     %'	E;	'	e*C -VS99
:@C D D  	L	s   A
 
AAc                     | d}	 t        |      }d|cxk  rdk  sn t        | d      |S # t        $ r t        |      t        $ r t        |      w xY w)z[Validates that 'value' is a float, or can be converted to one, and is
       positive.
    z must be an integer or floatr   g    eAz1 must be greater than 0 and less than one billion)floatrN   rE   )rG   rH   errmsgs      r3   validate_positive_floatrr     sp     289F e u?s?4:= > 	>L  !     s	   / (Ac                 0    |dk(  s|dk(  ryt        | |      S )zgValidates that 'value' is 0 or a positive float, or can be converted to
    0 or a positive float.
    r   0rr   rF   s     r3   validate_positive_float_or_zerorv   1  s!     zUc\"6511r5   c                 (    ||S t        | |      dz  S )zcValidates a timeout specified in milliseconds returning
    a value in floating point seconds.
         @@ru   rF   s     r3   validate_timeout_or_nonery   :  s      }"651F::r5   c                 V    |t        | d      |dk(  s|dk(  ryt        | |      dz  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.
    z cannot be Noner   rt   rx   )r   rr   rF   s     r3   validate_timeout_or_zeror{   C  s9     } !ABBzUc\"651F::r5   c                 :    |
|dk(  s|dk(  ryt        | |      dz  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   rt   rx   ru   rF   s     r3    validate_timeout_or_none_or_zeror}   P  s*    
 }
esl"651F::r5   c                 0    |dk(  s|dk(  ryt        | |      S )zBValidates maxStalenessSeconds according to the Max Staleness Spec.r*   z-1rb   rF   s     r3   validate_max_stalenessr   Z  s    {etm$VU33r5   c                 B    t        |t              st        |d      |S )z Validate a read preference.
    z is not a read preference.)rC   r   rE   r;   rH   s     r3   validate_read_preferencer   b  s!     e[)%ABBLr5   c                 2    |t         vrt        |d      |S )zValidate read preference mode for a MongoReplicaSetClient.

    .. versionchanged:: 3.5
       Returns the original ``value`` instead of the validated read preference
       mode.
    z is not a valid read preference)r   rN   r   s     r3   validate_read_preference_moder   j  s     M!GHHLr5   c                 Z    |t         vr"|dk7  rt        | dt        t                     |S )z+Validate the authMechanism URI option.
    zCRAM-MD5z must be in )r   rN   tuplerF   s     r3   validate_auth_mechanismr   v  s-     J5J#6vuZ7HIJJLr5   c                 j    	 t         |   S # t        $ r t        |dt        t                     w xY w)zAValidate the uuid representation option selected in the URI.
    z3 is an invalid UUID representation. Must be one of )_UUID_REPRESENTATIONSKeyErrorrN   r   r   s     r3   validate_uuid_representationr     sD    G$U++ G!&.C(DF G 	GGs    '2c                 P   t        |t              s|g}g }|D ]n  }|dk(  r|j                  i        	 i }|j                  d      D ]-  }|j                  d      \  }}t	        |      |t	        |      <   / |j                  |       p |S # t
        $ r t        |d|       w xY w)z:Parse readPreferenceTags if passed as a client kwarg.
     ,r)   z not a valid value for )rC   listappendsplitr   	ExceptionrN   )namerH   tag_setstag_settagstagr:   rW   s           r3   validate_read_preference_tagsr     s     eT"H ?b=OOB	?D}}S) <99S>S*6s*;\#&'< OOD!? O  	?/6> ? ?	?s   ABB%)SERVICE_NAMECANONICALIZE_HOST_NAMESERVICE_REALMAWS_SESSION_TOKENc                 N   t        | |      }i }|j                  d      D ]`  }	 |j                  d      \  }}|t        vrt        |dt	        t              d      |dk(  rt        ||      ||<   St        |      ||<   b |S # t        $ r d|v rd}t        d|d      w xY w)	z!Validate authMechanismProperties.r   r)   r   z_AWS_SESSION_TOKEN:<redacted token>, did you forget to percent-escape the token with quote_plus?zQauth mechanism properties must be key:value pairs like SERVICE_NAME:mongodb, not .z< is not a supported auth mechanism property. Must be one of r   )r]   r   rN   _MECHANISM_PROPSr   rO   r   )rG   rH   propsoptr:   rW   s         r3   "validate_auth_mechanism_propertiesr     s    FE*EE{{3 +		:yy~HC &&&)51A+BD E E **3C=E#J%c*E#J%+( L#  	:"c)F369 : :	:s   BB$c                 b    t        |t        j                  t        f      st	        | d      |S )z#Validate the document_class option.zf must be dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a sublass of collections.MutableMapping)
issubclassr   MutableMappingr   rE   rF   s     r3   validate_document_classr     s6    ec00/BCCIL M 	M Lr5   c                 R    |$t        |t              st        | dt              |S )z"Validate the type_registry option.z must be an instance of )rC   r   rE   rF   s     r3   validate_type_registryr     s-    E<!@L" # 	#Lr5   c                 B    t        |t              st        | d      |S )z!Validates that 'value' is a list.z must be a list)rC   r   rE   rF   s     r3   validate_listr     s    eT"v788Lr5   c                 "    ||S t        | |      S )z)Validates that 'value' is a list or None.)r   rF   s     r3   validate_list_or_noner     s    }''r5   c                 `    t        |t        j                  t        f      st	        | d      y)z/Validates that 'value' is a list or a document.zu must either be a list or an instance of dict, bson.son.SON, or any other type that inherits from collections.MappingN)rC   r   Mappingr   rE   rF   s     r3   validate_list_or_mappingr     s/    eckk40117: ; 	; 2r5   c                 T    t        |t        j                        st        | d      y)z=Validate the type of method arguments that expect a document.zd must be an instance of dict, bson.son.SON, or any other type that inherits from collections.MappingN)rC   r   r   rE   rF   s     r3   validate_is_mappingr     s*    eS[[)17: ; 	; *r5   c                 `    t        |t        j                  t        f      st	        | d      y)zEValidate the type of method arguments that expect a MongoDB document.z must be an instance of dict, bson.son.SON, bson.raw_bson.RawBSONDocument, or a type that inherits from collections.MutableMappingN)rC   r   r   r   rE   rF   s     r3   validate_is_document_typer     s7    ec00/BC 9?A B 	B Dr5   c                 |    ||S t        | |       t        |j                  d            dkD  rt        | d      |S )zValidate the appname option.zutf-8   z must be <= 128 bytes)r]   lenencoderN   rF   s     r3   validate_appname_or_noner     s?    }FE"
5<< !C'f>??Lr5   c                 J    ||S t        |t              st        | d      |S )z Validate the driver keyword arg.z" must be an instance of DriverInfo)rC   r   rE   rF   s     r3   validate_driver_or_noner     s)    }eZ(&JKKLr5   c                 @    ||S t        |      st        | d      |S )z%Validates that 'value' is a callable.z must be a callable)callablerN   rF   s     r3   validate_is_callable_or_noner     s&    }E?F<==Lr5   c                     t        d|        | rBt        | t              s1t        t	        |             }|j                  d      rt        d      yyy)z Validate a replacement document.replacement$z'replacement can not include $ operatorsN)r   rC   r   nextiterr.   rN   )r   firsts     r3   validate_ok_for_replacer     sN    {3:k?CT+&'C FGG ! D{r5   c                     t        d|        | st        d      t        | t               }t	        t        |             }|r|j                  d      st        d      yy)zValidate an update document.updatezupdate cannot be emptyr   z"update only works with $ operatorsN)r   rN   rC   r   r   r   r.   )r   is_documentr   s      r3   validate_ok_for_updater   #  s[    Xv.122 ..KfE5++C0=>> 1{r5   )strictreplaceignorec                 P    |t         vrt        |dt        t                     |S )zFValidate the Unicode decode error handler option of CodecOptions.
    z< is an invalid Unicode decode error handler. Must be one of )_UNICODE_DECODE_ERROR_HANDLERSrN   r   r   s     r3   %validate_unicode_decode_error_handlerr   3  s4     22!&.L(MO P 	P Lr5   c                 Z    |(t        |t        j                        st        d|z        |S )zValidate the tzinfo option
    z)%s must be an instance of datetime.tzinfo)rC   datetimetzinforE   r   s     r3   validate_tzinfor   =  s-     E8??!CCeKLLLr5   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tlscertificatekeyfilepasswordappnameauthmechanismauthmechanismproperties
authsourcecompressorsconnecttimeoutmsdirectconnectionheartbeatfrequencymsr   localthresholdmsmaxidletimemsmaxpoolsizemaxstalenesssecondsreadconcernlevelreadpreferencereadpreferencetags
replicaset
retryreadsretrywritesserverselectiontimeoutmssockettimeoutmsssl_keyfiler   r   r   c                      t        |   S N)rO   xs    r3   <lambda>r   r  s    /I1/M+M r5   r   r   r   tlsdisableocspendpointchecktlsinsecurewr   zlibcompressionlevel)connectdriverfsyncminpoolsizesocketkeepaliver   tz_awareunicode_decode_error_handleruuidrepresentationwaitqueuemultiplewaitqueuetimeoutms)	document_classtype_registryread_preferenceevent_listenersr   usernamepasswordserver_selectorauto_encryption_optsssl_check_ocsp_endpoint)
r   r   r   r   r   r   r   r   r   r   )renamedr   )r  
wTimeoutMS)r  tlsAllowInvalidCertificates)r  tlsAllowInvalidHostnames)r  
tlsCRLFile)r  	tlsCAFile)r  tlsCertificateKeyFilePassword)removedzqInstead 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  c                 T    t        | |      \  }}|t        vrt        d|       | |fS )z1Validate optional authentication parameters.
    zUnknown authentication option: )validate_AUTH_OPTIONSr   )rG   rH   r7   s      r3   validate_auth_optionr!    s>     FE*LE5M! @F"I J 	J5=r5   c                 p    | j                         }t        j                  |t              } || |      }| |fS )z!Generic validation function.
    )r7   
VALIDATORSgetr<   )rG   rH   r7   	validators       r3   r  r    s6     LLNEu&89Ife$E5=r5   c                 x    t         t              rt               }d } fd}ni }d }d }t               D ]<  \  }} ||      }	 t        j	                  |t
              } |||      }|| ||      <   > |S # t        t        t        f$ r,}	|rt        j                  t        |	             n Y d}	~	|d}	~	ww xY w)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 r    r   s    r3   r   z'get_validated_options.<locals>.<lambda>      1 r5   c                 &    j                  |       S r   )	cased_key)r   optionss    r3   r   z'get_validated_options.<locals>.<lambda>  s    7#4#4Q#7 r5   c                 "    | j                         S r   )r7   r   s    r3   r   z'get_validated_options.<locals>.<lambda>  s    1779 r5   c                     | S r   r(  r   s    r3   r   z'get_validated_options.<locals>.<lambda>  r)  r5   N)rC   _CaseInsensitiveDictionaryr	   URI_OPTIONS_VALIDATOR_MAPr$  r<   rN   rE   r   warningswarnstr)
r,  r2  validated_optionsget_normed_keyget_setter_keyr   rH   
normed_keyr%  excs
   `         r3   get_validated_optionsr9    s     '5668$7,$( B
U#C(

	B155.0Ic5)E =BnZ89B  I'9: 	c#h' (	s   #A99B9"B44B9)r  r   r   r  r   r   c                   b    e Zd ZdZd Zed        Zed        Zd Zed        Z	d Z
ed        Zy	)

BaseObjectzA base class that provides attributes and methods common
    to multiple pymongo classes.

    SHOULD NOT BE USED BY DEVELOPERS EXTERNAL TO MONGODB.
    c                    t        |t              st        d      || _        t        |t              st        |d      || _        t        |t              st        d      || _        t        |t              st        d      || _	        y )NzDcodec_options must be an instance of bson.codec_options.CodecOptionszR 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)
rC   r   rE   _BaseObject__codec_optionsr   _BaseObject__read_preferencer   _BaseObject__write_concernr   _BaseObject__read_concern)selfcodec_optionsr  write_concernread_concerns        r3   __init__zBaseObject.__init__'  s     -6 > ? ?,/;7*9< = = "1-6 A B B,,4 ? @ @*r5   c                     | j                   S )zdRead only access to the :class:`~bson.codec_options.CodecOptions`
        of this instance.
        )r=  rA  s    r3   rB  zBaseObject.codec_options?  s    
 ###r5   c                     | 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?  rG  s    r3   rC  zBaseObject.write_concernF  s     ###r5   c                 B    |r|j                   rt        S | j                  S )zKRead only access to the write concern of this instance or session.
        )in_transactionr   rC  rA  sessions     r3   _write_concern_forzBaseObject._write_concern_forP  s!     w--((!!!r5   c                     | 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>  rG  s    r3   r  zBaseObject.read_preferenceX  s     %%%r5   c                 Z    |r|j                         xs | j                  S | j                  S )zMRead only access to the read preference of this instance or session.
        )_txn_read_preferencer>  rK  s     r3   _read_preference_forzBaseObject._read_preference_fora  s-     //1KT5K5KK%%%r5   c                     | j                   S )zRead only access to the :class:`~pymongo.read_concern.ReadConcern`
        of this instance.

        .. versionadded:: 3.2
        )r@  rG  s    r3   rD  zBaseObject.read_concerni  s     """r5   N)rg   
__module____qualname____doc__rE  propertyrB  rC  rM  r  rQ  rD  r(  r5   r3   r;  r;     sf    +0 $ $ $ $" & && # #r5   r;  c                   p    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 ZddZd Zd Zd ZddZd Zd Zy
)r/  c                 T    i | _         i | _        | j                  t        |i |       y r   )%_CaseInsensitiveDictionary__casedkeys _CaseInsensitiveDictionary__datar   dict)rA  argskwargss      r3   rE  z#_CaseInsensitiveDictionary.__init__t  s'    D$)&)*r5   c                 :    |j                         | j                  v S r   )r7   rZ  rA  r:   s     r3   __contains__z'_CaseInsensitiveDictionary.__contains__y  s    yy{dkk))r5   c                 ,    t        | j                        S r   )r   rZ  rG  s    r3   __len__z"_CaseInsensitiveDictionary.__len__|  s    4;;r5   c                 (    d | j                   D        S )Nc              3       K   | ]  }|  y wr   r(  ).0r:   s     r3   	<genexpr>z6_CaseInsensitiveDictionary.__iter__.<locals>.<genexpr>  s     00s   )rY  rG  s    r3   __iter__z#_CaseInsensitiveDictionary.__iter__  s    0t//00r5   c                 t    t        | D ci c]  }| j                  |   | j                  |   ! c}      S c c}w r   )r3  rY  rZ  )rA  ks     r3   __repr__z#_CaseInsensitiveDictionary.__repr__  s3    FAD$$Q'Q7FGGFs   $5c                 `    |j                         }|| j                  |<   || j                  |<   y r   r7   rY  rZ  )rA  r:   rH   lc_keys       r3   __setitem__z&_CaseInsensitiveDictionary.__setitem__  s+    #& #Fr5   c                 <    | j                   |j                            S r   )rZ  r7   r_  s     r3   __getitem__z&_CaseInsensitiveDictionary.__getitem__  s    {{399;''r5   c                 X    |j                         }| j                  |= | j                  |= y r   rl  )rA  r:   rm  s      r3   __delitem__z&_CaseInsensitiveDictionary.__delitem__  s'    V$KKr5   c                     t        |t        j                        st        S t	        |       t	        |      k7  ry|D ]  }| |   ||   k7  s y y)NFT)rC   r   r   NotImplementedr   rA  otherr:   s      r3   __eq__z!_CaseInsensitiveDictionary.__eq__  sP    %-!!t9E
" 	CCyE#J&	 r5   Nc                 V    | j                   j                  |j                         |      S r   )rZ  r$  r7   )rA  r:   defaults      r3   r$  z_CaseInsensitiveDictionary.get  s    {{syy{G44r5   c                     |j                         }| j                  j                  |d         | j                  j                  |g|i |S r   )r7   rY  poprZ  )rA  r:   r\  r]  rm  s        r3   r{  z_CaseInsensitiveDictionary.pop  sB    VT*t{{v7777r5   c                 z    | j                   j                         \  }}| j                  j                  |      }||fS r   )rY  popitemrZ  r{  )rA  rm  r+  rH   s       r3   r}  z"_CaseInsensitiveDictionary.popitem  s8     ,,446	'%r5   c                 l    | j                   j                          | j                  j                          y r   )rY  clearrZ  rG  s    r3   r  z _CaseInsensitiveDictionary.clear  s$     r5   c                     |j                         }|| v r| j                  |   S || j                  |<   || j                  |<   |S r   )r7   rZ  rY  )rA  r:   ry  rm  s       r3   
setdefaultz%_CaseInsensitiveDictionary.setdefault  sF    $;;;v&&'*DV$")DKKNr5   c                     t        |t              r|D ]  }||   | |j                  |      <    y |D ]
  }||   | |<    y r   )rC   r/  r+  ru  s      r3   r   z!_CaseInsensitiveDictionary.update  sQ    e78 8-23ZU__S)*8  '!#JS	'r5   c                 <    | j                   |j                            S r   )rY  r7   r_  s     r3   r+  z$_CaseInsensitiveDictionary.cased_key  s    		,,r5   r   )rg   rS  rT  rE  r`  rb  rg  rj  rn  rp  rr  rw  r$  r{  r}  r  r  r   r+  r(  r5   r3   r/  r/  s  sS    +
* 1H$
( 
	58
 
'-r5   r/  )T)rU  r   r1  bsonr   bson.binaryr   bson.codec_optionsr   r   bson.py3compatr   r   r	   r
   r   bson.raw_bsonr   pymongo.authr   pymongo.compression_supportr   r   pymongo.driver_infor   pymongo.encryption_optionsr   pymongo.errorsr   pymongo.monitoringr   pymongo.read_concernr   pymongo.read_preferencesr   r   pymongo.ssl_supportr   r   pymongo.write_concernr   r   collectionsr   ORDERED_TYPESImportErrorurllib.parser   urllibMAX_BSON_SIZEMAX_MESSAGE_SIZEMIN_WIRE_VERSIONMAX_WIRE_VERSIONMAX_WRITE_BATCH_SIZEMIN_SUPPORTED_SERVER_VERSIONMIN_SUPPORTED_WIRE_VERSIONMAX_SUPPORTED_WIRE_VERSIONHEARTBEAT_FREQUENCYKILL_CURSOR_FREQUENCYEVENTS_QUEUE_FREQUENCYSERVER_SELECTION_TIMEOUTMIN_HEARTBEAT_INTERVALMIN_SRV_RESCAN_INTERVALCONNECT_TIMEOUTMAX_POOL_SIZEMIN_POOL_SIZEMAX_IDLE_TIME_MSMAX_IDLE_TIME_SECWAIT_QUEUE_TIMEOUTLOCAL_THRESHOLD_MSRETRY_WRITESRETRY_READSCOMMAND_NOT_FOUND_CODESUNAUTHORIZED_CODES_MAX_END_SESSIONSr4   r8   r<   UNSPECIFIEDSTANDARDPYTHON_LEGACYJAVA_LEGACYCSHARP_LEGACYr   rI   rO   rS   rX   rZ   r`   rc   re   r]   ri   rl   rn   rr   rv   ry   r{   r}   r   r   r   r   r   r   	frozensetr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   URI_OPTIONS_ALIAS_MAPr0  NONSPEC_OPTIONS_VALIDATOR_MAPKW_VALIDATORSINTERNAL_URI_OPTION_NAME_MAPURI_OPTIONS_DEPRECATION_MAPr   optnamealiasesaliascopyr#  TIMEOUT_OPTIONSr   r!  r  r9  WRITE_CONCERN_OPTIONSobjectr;  r   r/  r(  r5   r3   <module>r     s    @    * 9 J J ) #J * L - 8 , ?? E'+&M )# !}$      %                                (   	; &11"++&44$00&44 <+O	48J*7D(2;
;;4	G.  3 4 6(;;BH
? "++J!K  u,7$3#4!5 6 / !,-&:%;
  $'$,$ A$ /	$
 '$ 8$ 2$ 4$ )$ 7$ -$ 4$ 1$ /$ 3$  7!$" )#$$ ,%$& -'$(  8)$* 7+$, $-$. 
%/$0 "#?1$2 '3$4  M5$6 47$8 "9$: .;$< $%<=$> "#=?$@ -A$B 	0C$D /E$F ;G$ R *%'01#*$I6>2! $ .+/0''3A
" 
#2 4+%9#<  . 
 )?A,,F: (     !> ?!"78 4GW 411)'2 &e,44 '++-
 
  -   456 H " #  P# P#fM-!3!3 M-S  FMs   8
K# #K/.K/