+
    8i                    2   R t ^ RIHt ^ RIHtHtHtHtHtH	t	H
t
 ^ RIHt ]'       d   ^ RIHt ^ RIHt ]	! R4      t]]]3,          t]],          t ! R R4      tR	 R
 ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR# )zFCriteria to select some ServerDescriptions from a TopologyDescription.)annotations)TYPE_CHECKINGAnyMappingOptionalSequenceTypeVarcast)SERVER_TYPE)ServerDescription)TopologyDescriptionTc                      ] tR t^ tRt]R R l4       tR R ltR R ltR R	 lt	]
R
 R l4       t]
R R l4       t]
R R l4       tR R ltR R ltRtR# )	Selectionz.Input or output of a server selector function.c                    V ^8  d   QhRRRR/# )   topology_descriptionr   returnr    )formats   "V/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pymongo/server_selectors.py__annotate__Selection.__annotate__$   s     
 
=P 
U^ 
    c                	    VP                   pR pV F&  pVP                  \        P                  8X  g   K$  Tp M	  \	        VVP                   VP
                  V4      # N)candidate_serversserver_typer
   	RSPrimaryr   common_wire_version)clsr   r   primarysds   &&   r   from_topology_description#Selection.from_topology_description#   s^    0BB#B~~!6!66 $
   22 44	
 	
r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   server_descriptionslist[ServerDescription]r   zOptional[int]r!   Optional[ServerDescription]r   )r   s   "r   r   r   3   s2     
7 
71
7 5
7 +	
7
 -
7r   c                	6    Wn         W n        W@n        W0n        R # r   )r   r&   r!   r   )selfr   r&   r   r!   s   &&&&&r   __init__Selection.__init__3   s     %9!#6 #6 r   c                    V ^8  d   QhRRRR/# )r   r&   r'   r   r   r   )r   s   "r   r   r   ?   s     
 
<S 
Xa 
r   c                	X    \        V P                  WP                  V P                  4      # r   )r   r   r   r!   )r*   r&   s   &&r   with_server_descriptions"Selection.with_server_descriptions?   s*    %%':<T<TVZVbVb
 	
r   c                   V ^8  d   QhRR/# )r   r   r(   r   )r   s   "r   r   r   D   s      4O r   c                	p    \        V 4      pVP                  '       d   \        VP                  R  R7      # R# )c                6    \        \        V P                  4      # r   )r	   floatlast_write_date)r"   s   &r   <lambda>>Selection.secondary_with_max_last_write_date.<locals>.<lambda>H   s    UBL^L^@_r   )keyN)secondary_server_selectorr&   max)r*   secondariess   & r   "secondary_with_max_last_write_date,Selection.secondary_with_max_last_write_dateD   s6    /5***//5_  r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   M   s     8 89 8r   c                	f    V P                   '       d   V P                   .M. pV P                  V4      # r   )r!   r/   )r*   	primariess   & r   primary_selectionSelection.primary_selectionL   s(    &*lllT\\N	,,Y77r   c                   V ^8  d   QhRR/# r   r   intr   )r   s   "r   r   r   R   s     = =S =r   c                	.    V P                   P                  # r   )r   heartbeat_frequencyr*   s   &r   rG   Selection.heartbeat_frequencyQ   s    ((<<<r   c                   V ^8  d   QhRR/# rD   r   )r   s   "r   r   r   V   s     7 7s 7r   c                	.    V P                   P                  # r   )r   topology_typerH   s   &r   rL   Selection.topology_typeU   s    ((666r   c                   V ^8  d   QhRR/# )r   r   boolr   )r   s   "r   r   r   Y   s     . .$ .r   c                	,    \        V P                  4      # r   )rO   r&   rH   s   &r   __bool__Selection.__bool__Y   s    D,,--r   c                    V ^8  d   QhRRRR/# )r   itemrE   r   r   r   )r   s   "r   r   r   \   s     . . .(9 .r   c                	(    V P                   V,          # r   )r&   )r*   rT   s   &&r   __getitem__Selection.__getitem__\   s    ''--r   )r   r!   r&   r   N)__name__
__module____qualname____firstlineno____doc__classmethodr#   r+   r/   r<   propertyrA   rG   rL   rQ   rV   __static_attributes__r   r   r   r   r       sq    8
 

7

 8 8 = = 7 7.. .r   r   c                    V ^8  d   QhRRRR/# )r   	selectionr   r   r   )r   s   "r   r   r   `   s      1  r   c                    V # r   r   ra   s   &r   any_server_selectorrd   `   s    r   c                    V ^8  d   QhRRRR/# r   ra   r   r   r   )r   s   "r   r   r   d         	 i r   c                    T P                  V P                   Uu. uF  qP                  '       g   K  VNK  	  up4      # u upi r   )r/   r&   is_readablera   ss   & r   readable_server_selectorrl   d   8    --11C1q]]1C C   ??c                    V ^8  d   QhRRRR/# rf   r   )r   s   "r   r   r   j   rg   r   c                    T P                  V P                   Uu. uF  qP                  '       g   K  VNK  	  up4      # u upi r   )r/   r&   is_writablerj   s   & r   writable_server_selectorrr   j   rm   rn   c                    V ^8  d   QhRRRR/# rf   r   )r   s   "r   r   r   p   s       y r   c                    T P                  V P                   Uu. uF%  qP                  \        P                  8X  g   K#  VNK'  	  up4      # u upi r   )r/   r&   r   r
   RSSecondaryrj   s   & r   r9   r9   p   sC    --11^1q]]kF]F]5]1^ ^
    AAc                    V ^8  d   QhRRRR/# rf   r   )r   s   "r   r   r   v   s      y Y r   c                    T P                  V P                   Uu. uF%  qP                  \        P                  8X  g   K#  VNK'  	  up4      # u upi r   )r/   r&   r   r
   	RSArbiterrj   s   & r   arbiter_server_selectorrz   v   sC    --11\1q]]kF[F[5[1\ \rv   c                    V ^8  d   QhRRRR/# rf   r   )r   s   "r   r   r   |   s     W W) W	 Wr   c                >    \        V 4      ;'       g    \        V 4      # )z6Like PrimaryPreferred but doesn't use tags or latency.)rr   r9   rc   s   &r   "writable_preferred_server_selectorr}   |   s    #I.VV2KI2VVr   c               $    V ^8  d   QhRRRRRR/# )r   tag_setTagSetra   r   r   r   )r   s   "r   r   r      s!      & Y 9 r   c                   a  R V 3R llpTP                  VP                   Uu. uF  q2! VP                  4      '       g   K  VNK   	  up4      # u upi )zAll servers matching one tag set.

A tag set is a dict. A server matches if its tags are a superset:
A server tagged {'a': '1', 'b': '2'} matches the tag set {'a': '1'}.

The empty tag set {} matches any server.
c                    V ^8  d   QhRRRR/# )r   server_tagszMapping[str, Any]r   rO   r   )r   s   "r   r   *apply_single_tag_set.<locals>.__annotate__   s       1 d r   c                f   < SP                  4        F  w  rW9  g   W,          V8w  g   K   R # 	  R# )FT)items)r   r8   valuer   s   &  r   
tags_match(apply_single_tag_set.<locals>.tags_match   s-    !--/JC%)9U)B * r   )r/   r&   tags)r   ra   r   rk   s   f&  r   apply_single_tag_setr      sL      --11H1qZ5G1H Hs   AAc               $    V ^8  d   QhRRRRRR/# r   tag_setsTagSetsra   r   r   r   )r   s   "r   r   r      s!     2 2W 2 2y 2r   c                d    V  F  p\        W!4      pV'       g   K  Vu # 	  VP                  . 4      # )a6  All servers match a list of tag sets.

tag_sets is a list of dicts. The empty tag set {} matches any server,
and may be provided at the end of the list as a fallback. So
[{'a': 'value'}, {}] expresses a preference for servers tagged
{'a': 'value'}, but accepts any server if none matches the first
preference.
)r   r/   )r   ra   r   with_tag_sets   &&  r   apply_tag_setsr      s6     +G?< 
 --b11r   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r      s'     J J' Ji JT] Jr   c                ,    \        V \        V4      4      # )z2All near-enough secondaries matching the tag sets.)r   r9   r   ra   s   &&r   #secondary_with_tags_server_selectorr      s    ($=i$HIIr   c               $    V ^8  d   QhRRRRRR/# r   r   )r   s   "r   r   r      s'     I Iw I9 IQZ Ir   c                ,    \        V \        V4      4      # )z.All near-enough members matching the tag sets.)r   rl   r   s   &&r    member_with_tags_server_selectorr      s    ($<Y$GHHr   N) r\   
__future__r   typingr   r   r   r   r   r   r	   pymongo.server_typer
   pymongo.server_descriptionr   pymongo.topology_descriptionr   r   strr   r   r   rd   rl   rr   r9   rz   r}   r   r   r   r   r   r   r   <module>r      s    M " Q Q Q +<@ CL	c	
6
=. =.@W
*2"J
Ir   