
    hۃ                         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% 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l0m1Z1 nddl2m1Z1 dZ3de3z  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& ZMd' ZNd( ZOej                  ej                  ej                  ej                  ej                  d)ZUd* ZVd+ ZWd, ZXd- ZYd. ZZd/ Z[d0 Z\d1 Z]d2 Z^d3 Z_d4 Z`d5 Zad6 Zbd7 Zcd8 Zdd9 Zed: Zfd; Zgd< Zhd= Zid> Zjd? Zkd@ Zl emg dA      ZndB ZodC ZpdD ZqdE ZrdF ZsdG ZtdH ZudI ZvdJ ZwdK ZxdL ZydM ZzdN Z{dO Z| emg dP      Z}dQ Z~dR ZdSgdTgdUgdVgdWgdXgdYgdZgd[gd\	Zi d]ewd^ejd_eod`e^daedbefdceWddeddeeWdfecdgeddhe\diegdje_dkeidleldme_i dneWdoeWdpeWdqeedrefdse[dteWdue'dVe(dvdw dWeWdxe[dye[dze_d{d| d}eWd~eaeZedZeWexeyeWeZeWe[eWe~eke]eddZepeqeheee_e_ezed	ZdeddUdVdWdXdYdZd[dd
Zddddddddddd
Zej                  e        ee      D ]  \  ZZeD ]  Zeevsee   ee<     ej                         Zej                  e       g dZ emd_g      Zd Zd ZddZ emg d      Z G d de      Z G d dej(                        Zy# e/$ r efZ.Y tw xY w)z9Functions and classes common to multiple pymongo modules.    N)SON)UuidRepresentation)CodecOptionsTypeRegistry)PY3abcinteger_types	iteritemsstring_type)RawBSONDocument)
MECHANISMS)validate_compressorsvalidate_zlib_compression_level)
DriverInfo)%validate_auto_encryption_opts_or_noneConfigurationError)_validate_event_listeners)ReadConcern)_MONGOS_MODES_ServerMode)	ServerApi)validate_allow_invalid_certsvalidate_cert_reqs)DEFAULT_WRITE_CONCERNWriteConcern)OrderedDict)unquote_plusi      i  z2.6   
         g      ?<   g      4@d      T);   )r    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       L/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/pymongo/common.pypartition_noder4   |   s_    DD
**S/C
by$3ZT#')_!5dsAbz:    c                 B    t        |       \  }}|j                         |fS )z6Split and normalize a node name from a hello 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      s:    %%))vWXXFE**r5   c                     t        |t              r|S t        |t              r	 t        |      S t        d| d      # t        $ r t	        d| d      w xY w)zDValidates 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      s\    %'	E;	'	Ru: VM
NN  	RPQQ	Rs	   
> Ac                 F    t        | |      }|dk  rt        d| d      |S )zFValidate 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      s(    
65
)C
axFTUUJr5   c                 F    t        | |      }|dk  rt        d| d      |S )z1Validate that 'value' is a positive integer or 0.r   rM   z must be a non negative integerrU   rV   s      r3   validate_non_negative_integerrZ      s)    
65
)C
QwPVXYYJr5   c                 Z    ||S t        | |      }t        |d      j                          |S )z1Validates that 'value' is file-like and readable.r)validate_stringopencloserF   s     r3   validate_readabler`      s2    } FE*ELr5   c                 "    ||S t        | |      S )z4Validate 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 )z9Validate 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]      s.     %%
CI;K_K_` r5   c                 "    ||S t        | |      S )z@Validates 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)/Validates that 'value' is an integer or string.rQ   z&, value must be an integer or a stringrR   rF   s     r3   validate_int_or_basestringrl      sQ    %'	E;	'	u: TZ\
]]  	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     sa    %'	E;	'	e*C -VS99
U[]   	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)zXValidates 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     sj     289F e u?s?U[]^^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   '  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   0  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{   9  s9     } !@AA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}   F  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   P  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   X  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   _  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   k  s-    
 J5J#6vuZ7HIJJLr5   c                 j    	 t         |   S # t        $ r t        |dt        t                     w xY w)z<Validate 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   u  s@    
$U++ 
 5!679
 	

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)z5Parse 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 Qb=OOB	QD}}S) <99S>S*6s*;\#&'< OOD!Q O  	Q$OPP	Q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 && e$457 
 **3C=E#J%c*E#J1+4 L/  	"c)C   '*, 	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 8>@
 	

 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<!@&,OPP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     s1    eckk401 &,.
 	
 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[[) &,.
 	
 *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     s4    ec00/BC -35
 	
 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                 J    ||S t        |t              st        | d      |S )z$Validate the server_api keyword arg.z! must be an instance of ServerApi)rC   r   rE   rF   s     r3   validate_server_api_or_noner     s)    }eY'IJJ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 )zAValidate 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   ;  s2    22 5!?@B
 	

 Lr5   c                 Z    |(t        |t        j                        st        d|z        |S )zValidate the tzinfo optionz)%s must be an instance of datetime.tzinfo)rC   datetimetzinforE   r   s     r3   validate_tzinfor   F  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loadbalancedserverselectiontimeoutmssockettimeoutmsssl_keyfiler   r   r   c                      t        |   S NrO   xs    r3   <lambda>r  |  s    /I1/M+M r5   r   r   r   tlsdisableocspendpointcheckc                      t        |   S r   r   r   s    r3   r  r    s    2La2P.P r5   tlsinsecurew)r   zlibcompressionlevel)connectdriver
server_api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_optsr   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)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  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  c                 T    t        | |      \  }}|t        vrt        d|       | |fS )z,Validate optional authentication parameters.zUnknown authentication option: )validate_AUTH_OPTIONSr   )rG   rH   r7   s      r3   validate_auth_optionr'    s2    FE*LE5M! 6!STT5=r5   c                 p    | j                         }t        j                  |t              } || |      }| |fS )zGeneric validation function.)r7   
VALIDATORSgetr<   )rG   rH   r7   	validators       r3   r%  r%    s4    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)
r2  r8  validated_optionsget_normed_keyget_setter_keyr   rH   
normed_keyr+  excs
   `         r3   get_validated_optionsr?    s     '5668$7,$( B
U#C(
		B155jBTUI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Y   -/;7 .0 
 "1-6\   -,4Y  +r5   c                     | j                   S )zdRead only access to the :class:`~bson.codec_options.CodecOptions`
        of this instance.
        )rC  rG  s    r3   rH  zBaseObject.codec_optionsW  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.
        )rE  rM  s    r3   rI  zBaseObject.write_concern^  s     ###r5   c                 B    |r|j                   rt        S | j                  S )zBRead only access to the write concern of this instance or session.)in_transactionr   rI  rG  sessions     r3   _write_concern_forzBaseObject._write_concern_forh  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.
        )rD  rM  s    r3   r  zBaseObject.read_preferenceo  s     %%%r5   c                 Z    |r|j                         xs | j                  S | j                  S )zDRead only access to the read preference of this instance or session.)_txn_read_preferencerD  rQ  s     r3   _read_preference_forzBaseObject._read_preference_forx  s-     //1KT5K5KK%%%r5   c                     | j                   S )zRead only access to the :class:`~pymongo.read_concern.ReadConcern`
        of this instance.

        .. versionadded:: 3.2
        )rF  rM  s    r3   rJ  zBaseObject.read_concern  s     """r5   N)rg   
__module____qualname____doc__rK  propertyrH  rI  rS  r  rW  rJ  r.  r5   r3   rA  rA  4  sf    +8 $ $ $ $" & && # #r5   rA  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
)r5  c                 T    i | _         i | _        | j                  t        |i |       y r   )%_CaseInsensitiveDictionary__casedkeys _CaseInsensitiveDictionary__datar   dict)rG  argskwargss      r3   rK  z#_CaseInsensitiveDictionary.__init__  s'    D$)&)*r5   c                 :    |j                         | j                  v S r   )r7   r`  rG  r:   s     r3   __contains__z'_CaseInsensitiveDictionary.__contains__  s    yy{dkk))r5   c                 ,    t        | j                        S r   )r   r`  rM  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   )r_  rM  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   )r9  r_  r`  )rG  ks     r3   __repr__z#_CaseInsensitiveDictionary.__repr__  s3    FAD$$Q'Q7FGGFs   $5c                 `    |j                         }|| j                  |<   || j                  |<   y r   r7   r_  r`  )rG  r:   rH   lc_keys       r3   __setitem__z&_CaseInsensitiveDictionary.__setitem__  s+    #& #Fr5   c                 <    | j                   |j                            S r   )r`  r7   re  s     r3   __getitem__z&_CaseInsensitiveDictionary.__getitem__  s    {{399;''r5   c                 X    |j                         }| j                  |= | j                  |= y r   rr  )rG  r:   rs  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   rG  otherr:   s      r3   __eq__z!_CaseInsensitiveDictionary.__eq__  sP    %-!!t9E
" 	CCyE#J&	 r5   Nc                 V    | j                   j                  |j                         |      S r   )r`  r*  r7   )rG  r:   defaults      r3   r*  z_CaseInsensitiveDictionary.get  s    {{syy{G44r5   c                     |j                         }| j                  j                  |d         | j                  j                  |g|i |S r   )r7   r_  popr`  )rG  r:   rb  rc  rs  s        r3   r  z_CaseInsensitiveDictionary.pop  sB    VT*t{{v7777r5   c                 z    | j                   j                         \  }}| j                  j                  |      }||fS r   )r_  popitemr`  r  )rG  rs  r1  rH   s       r3   r  z"_CaseInsensitiveDictionary.popitem  s8     ,,446	'%r5   c                 l    | j                   j                          | j                  j                          y r   )r_  clearr`  rM  s    r3   r  z _CaseInsensitiveDictionary.clear  s$     r5   c                     |j                         }|| v r| j                  |   S || j                  |<   || j                  |<   |S r   )r7   r`  r_  )rG  r:   r  rs  s       r3   
setdefaultz%_CaseInsensitiveDictionary.setdefault  sF    $;;;v&&'*DV$")DKKNr5   c                     t        |t              r|D ]  }||   | |j                  |      <    y |D ]
  }||   | |<    y r   )rC   r5  r1  r{  s      r3   r   z!_CaseInsensitiveDictionary.update  sQ    e78 8-23ZU__S)*8  '!#JS	'r5   c                 <    | j                   |j                            S r   )r_  r7   re  s     r3   r1  z$_CaseInsensitiveDictionary.cased_key  s    		,,r5   r   )rg   rY  rZ  rK  rf  rh  rm  rp  rt  rv  rx  r}  r*  r  r  r  r  r   r1  r.  r5   r3   r5  r5    sS    +
* 1H$
( 
	58
 
'-r5   r5  )T)r[  r   r7  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.server_apir   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   r   URI_OPTIONS_ALIAS_MAPr6  NONSPEC_OPTIONS_VALIDATOR_MAPKW_VALIDATORSINTERNAL_URI_OPTION_NAME_MAPURI_OPTIONS_DEPRECATION_MAPr   optnamealiasesaliascopyr)  TIMEOUT_OPTIONSr&  r'  r%  r?  WRITE_CONCERN_OPTIONSobjectrA  r   r5  r.  r5   r3   <module>r     s    @    * 9 J J ) # + L - 8 , ? ( P E'+&M )# !}$      %                                (   	; &11"++&44$00&44 <+	O48*	^&2;
;;4		
* T 
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 '5'8  M9': 4;'< "='> .?'@ $%<A'D "#PE'F -G'H 	0I'J 0;M' X *%-'01#*$I6>2! & .+/0''3A
" 
#2 4+%9#<  . 
 )?A,, G=% P     !> ?!"78 RGW R11/H/Q%e,RR '++-
 
  -   456F ""Z[ R# R#jM-!3!3 M-y  FMs   >
K1 1K=<K=