+
    i^  c            
       s   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt Rt	Rt
RtRtRtRtR	tR
tRt]R]R]R]R]R/t]P&                  ! R4      t ! R R]4      t ! R R]4      t]t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R ]4      tR! t R" t!R.R# lt"]PF                  ! R$R%4      t$R]3R& lt%R.R' lt& ! R( R)]4      t' ! R* R+]4      t( ! R, R-])4      t*R# )/z"Brian Quinlan (brian@sweetapp.com)N)isliceFIRST_COMPLETEDFIRST_EXCEPTIONALL_COMPLETED_AS_COMPLETEDPENDINGRUNNING	CANCELLEDCANCELLED_AND_NOTIFIEDFINISHEDpendingrunning	cancelledfinishedzconcurrent.futuresc                   s    ] tR t^'tRtR# )Error N__name__
__module____qualname____firstlineno____static_attributes__r       1/usr/lib64/python3.14/concurrent/futures/_base.pyr   r   '       r   r   c                   s    ] tR t^+tRtR# )CancelledErrorr   Nr   r   r   r   r   r   +   r   r   r   c                   s    ] tR t^1tRtR# )InvalidStateErrorr   Nr   r   r   r   r   r   1   r   r   r   c                   s8   a  ] tR t^5t o R tR tR tR tRtV t	R# )_Waiterc                sH    \         P                  ! 4       V n        . V n        R # N)	threadingZEventeventfinished_futuresself   &r   __init__Z_Waiter.__init__7   s    __&
 "r   c                <    V P                   P                  V4       R # r   r   appendr!   future   &&r   
add_resultZ_Waiter.add_result;       $$V,r   c                r$   r   r%   r'   r)   r   add_exceptionZ_Waiter.add_exception>   r+   r   c                r$   r   r%   r'   r)   r   add_cancelledZ_Waiter.add_cancelledA   r+   r   )r   r   N)
r   r   r   r   r#   r*   r,   r-   r   __classdictcell____classdict__   @r   r   r   5   s     #--- -r   r   c                   sV   a a ] tR t^Dt oV 3R ltV 3R ltV 3R ltV 3R ltRtVt	V ;t
# )_AsCompletedWaiterc                s`   < \         \        V `  4        \        P                  ! 4       V n        R # r   )superr2   r#   r   Locklock)r!   	__class__s   &r   r#   Z_AsCompletedWaiter.__init__G   s     $02NN$	r   c                   < V P                   ;_uu_ 4        \        \        V `  V4       V P                  P                  4        R R R 4       R #   + '       g   i     R # ; ir   )r5   r3   r2   r*   r   setr!   r(   r6      &&r   r*   Z_AsCompletedWaiter.add_resultK   s6    YYY$d6v>JJNN YYY   .AA	c                r7   r   )r5   r3   r2   r,   r   r8   r9   r:   r   r,   Z _AsCompletedWaiter.add_exceptionP   6    YYY$d9&AJJNN YYYr;   c                r7   r   )r5   r3   r2   r-   r   r8   r9   r:   r   r-   Z _AsCompletedWaiter.add_cancelledU   r<   r;   )r5   )r   r   r   r   r#   r*   r,   r-   r   r.   __classcell__r6   r0      @@r   r2   r2   D   s     %

 r   r2   c                   sJ   a a ] tR t^Zt oV 3R ltV 3R ltV 3R ltRtVtV ;t	# )_FirstCompletedWaiterc                Z   < \         SV `  V4       V P                  P                  4        R # r   )r3   r*   r   r8   r9   r:   r   r*   Z _FirstCompletedWaiter.add_result]   s    6"

r   c                rA   r   )r3   r,   r   r8   r9   r:   r   r,   Z#_FirstCompletedWaiter.add_exceptiona       f%

r   c                rA   r   )r3   r-   r   r8   r9   r:   r   r-   Z#_FirstCompletedWaiter.add_cancellede   rB   r   r   )
r   r   r   r   r*   r,   r-   r   r.   r=   r>   r?   r   r@   r@   Z   s      r   r@   c                   s\   a a ] tR t^it oV 3R ltR tV 3R ltV 3R ltV 3R ltRt	Vt
V ;t# )_AllCompletedWaiterc                sp   < Wn         W n        \        P                  ! 4       V n        \
        SV `  4        R # r   )num_pending_callsstop_on_exceptionr   r4   r5   r3   r#   )r!   rD   rE   r6   s   &&&r   r#   Z_AllCompletedWaiter.__init__l   s(    !2!2NN$	r   c                s    V P                   ;_uu_ 4        V ;P                  ^,          un        V P                  '       g   V P                  P                  4        RRR4       R#   + '       g   i     R# ; i)   N)r5   rD   r   r8   r    r"   r   _decrement_pending_callsZ,_AllCompletedWaiter._decrement_pending_callsr   sB    YYY""a'")))

  YYYs   AA%%A6	c                F   < \         SV `  V4       V P                  4        R # r   )r3   r*   rG   r9   r:   r   r*   Z_AllCompletedWaiter.add_resultx   s    6"%%'r   c                s   < \         SV `  V4       V P                  '       d   V P                  P	                  4        R # V P                  4        R # r   )r3   r,   rE   r   r8   rG   r9   r:   r   r,   Z!_AllCompletedWaiter.add_exception|   s6    f%!!!JJNN))+r   c                rH   r   )r3   r-   rG   r9   r:   r   r-   Z!_AllCompletedWaiter.add_cancelled   s    f%%%'r   )r5   rD   rE   )r   r   r   r   r#   rG   r*   r,   r-   r   r.   r=   r>   r?   r   rC   rC   i   s#     !(,( (r   rC   c                   s2   a  ] tR t^t o R tR tR tRtV tR# )_AcquireFuturesc                s2    \        V\        R 7      V n        R# ))ZkeyN)Zsortedidfutures)r!   rK   r)   r   r#   Z_AcquireFutures.__init__   s    g2.r   c                s`    V P                    F  pVP                  P                  4        K  	  R # r   )rK   
_conditionZacquirer'      & r   	__enter__Z_AcquireFutures.__enter__   "    llF%%' #r   c                s`    V P                    F  pVP                  P                  4        K  	  R # r   )rK   rL   Zrelease)r!   argsr(   s   &* r   __exit__Z_AcquireFutures.__exit__   rO   r   )rK   N)	r   r   r   r   r#   rN   rQ   r   r.   r/   r1   r   rI   rI      s     /(( (r   rI   c                 sR   V\         8X  d   \        4       pMlV\        8X  d   \        4       pMV\	        R  V  4       4      pV\
        8X  d   \        VRR7      pM+V\        8X  d   \        VRR7      pM\        RV,          4      hV  F  pVP                  P                  V4       K   	  V# )c              3   sR   "   T F  qP                   \        \        39  x  K  	  R # 5ir   _stater   r	   .0frM   r   	<genexpr>Z._create_and_install_waiters.<locals>.<genexpr>   s!      PLNq!7 BBBs   %'T)rE   FzInvalid return condition: %r)r   r2   r   r@   Zsumr   rC   r   
ValueError_waitersr&   )fsreturn_whenwaiterZpending_countrV   s   &&   r   _create_and_install_waitersr]      s    m##%		'&( PLNP P /)($OFM)(%PF;kIJJ	

&!  Mr   c              #   s$  "   V '       dq   V R,          pV F  pVP                  V4       K  	  VP                  ;_uu_ 4        VP                  P                  V4       RRR4       ?V P                  4       x  Kx  R#   + '       g   i     L'; i5i)rF   Ni)removerL   rY   pop)rZ   r\   ref_collectrV   Zfutures_sets   &&&  r   _yield_finished_futuresra      se      rF&Kq! '\\\JJf% ffh  \s"   B7BA=B=B	Bc           
   #   s  "   Ve   V\         P                  ! 4       ,           p\        V 4      p \        V 4      p\	        V 4      ;_uu_ 4        \        R V  4       4      pW,
          p\        V \        4      pR R R 4       \        X4      p \        VXV 3R7       R j  xL
  X'       d   Vf   R pM@X\         P                  ! 4       ,
          pV^ 8  d   \        R\        V4      V3,          4      hVP                  P                  V4       VP                  ;_uu_ 4        VP                  p. Vn        VP                  P                  4        R R R 4       VP                  4        \        WFW3R7       R j  xL
  K   V  F;  pVP                   ;_uu_ 4        VP"                  P%                  V4       R R R 4       K=  	  R #   + '       g   i     ELT; i EL9  + '       g   i     L; i Lt  + '       g   i     K~  ; i  T  FO  pTP                   ;_uu_ 4        TP"                  P%                  X4       R R R 4       K=    + '       g   i     KN  ; i	  i ; i5i)Nc              3   s`   "   T F$  pVP                   \        \        39   g   K   Vx  K&  	  R # 5ir   rR   rT   rM   r   rW   Zas_completed.<locals>.<genexpr>   s+      Ca88 6AA 2s   .
.)r`   z%d (of %d) futures unfinished)time	monotonicr8   lenrI   r]   r   Zlistra   TimeoutErrorr   waitr5   r   ZclearreverserL   rY   r^   )	rZ   timeoutend_timeZtotal_futuresr   r
   r\   Zwait_timeoutrV   s	   &&       r   as_completedrj      s    $ T^^--	RBGM			 CC C -,R? 
 H~H**8V8:u> 	> 	> #'$..*::!#&;L-?9 9: : LLl+!22*,'""$  .x<>=J J J' 0 A

!!&)  G 
			> J  A

!!&)  s   A
I+G7IH GH *A6H  .G)H 7G,8H ?IG.4IG		IH G)	$	H .G?9	III8
IIIIDoneAndNotDoneFutureszdone not_donec                 s   \        V 4      p \        V 4      ;_uu_ 4        V  Uu0 uF"  pVP                  \        \        39   g   K   VkK$  	  ppW,
          pV\
        8X  d   V'       d   \        WE4      uuR R R 4       # V\        8X  dX   V'       dP   \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        WE4      uuR R R 4       # \        V4      \        V 4      8X  d   \        WE4      uuR R R 4       # \        W4      pR R R 4       XP                  P                  V4       V  F;  pVP                  ;_uu_ 4        VP                  P                  V4       R R R 4       K=  	  XP!                  VP"                  4       \        W@V,
          4      # u upi   + '       g   i     L; i  + '       g   i     K  ; i)Nc              3   s~   "   T F3  pVP                  4       '       d   K  VP                  4       f   K/  Vx  K5  	  R # 5ir   )r   	exceptionrT   rM   r   rW   Zwait.<locals>.<genexpr>"  s/      Gd++- ,-KKM 1ds   ==
=TF)r8   rI   rS   r   r	   r   rk   r   Zanyrd   r]   r   rf   rL   rY   r^   Zupdater   )rZ   rh   r[   rV   doneZnot_doner\   s   &&&    r   rf   rf     sh   2 
RB			 F2ahh#98"DD 2 F9?*(8 
	 _,$s Gd Gsss Gd G G G,T< 
	 t9B(8 
	 -R= 
  LLg\\\JJf% \  	KK''( Dy11+F 
	$ \\s^   F/F*F*F/)
F/>F/
F/F/0F/
F/ #F/F/G*F//F?	Gc                 s      V P                  V4      V P                  4        ? #   T P                  4        i ; i  ? i ; ir   )resultcancel)Zfutrh   r)   r   _result_or_cancelrp   4  s9    	::g&JJL  JJL s   % : 7: =c                   s   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tRR ltRR ltR tR tR t]! ]P(                  4      tRtV tR# )Futurei?  c                s    \         P                  ! 4       V n        \        V n        R V n        R V n        . V n        . V n        R # r   )	r   Z	ConditionrL   r   rS   _result
_exceptionrY   _done_callbacksr    r"   r   r#   ZFuture.__init__B  s6    #--/!r   c                s    V P                    F  p V! V 4       K  	  R#   \         d    \        P                  R T 4        K6  i ; i)!exception calling callback for %rN)rt   	ExceptionLOGGERrl   )r!   ZcallbackrM   r   _invoke_callbacksZFuture._invoke_callbacksK  sC    ,,HL -  L  !DdKLs   !AAc                s   V P                   ;_uu_ 4        V P                  \        8X  d   V P                  '       dh   R V P                  P
                  \        V 4      \        V P                  ,          V P                  P                  P
                  3,          uuRRR4       # RV P                  P
                  \        V 4      \        V P                  ,          V P                  P                  P
                  3,          uuRRR4       # RV P                  P
                  \        V 4      \        V P                  ,          3,          uuRRR4       #   + '       g   i     R# ; i)z<%s at %#x state=%s raised %s>Nz <%s at %#x state=%s returned %s>z<%s at %#x state=%s>)	rL   rS   r	   rs   r6   r   rJ   _STATE_TO_DESCRIPTION_MAPrr   r    r"   r   __repr__ZFuture.__repr__R  s    ___{{h&???;//41$++>11::	?< < _ >//41$++>..77	A9 9 _ *NN++tH,T[[9-; ; ___s   'EAE$AE=EE$	c                sh   V P                   ;_uu_ 4        V P                  \        \        39   d    R R R 4       R# V P                  \        \
        39   d    R R R 4       R# \        V n        V P                   P                  4        R R R 4       V P                  4        R#   + '       g   i     L"; i)NFT)rL   rS   r   r	   r   r   
notify_allrx   r    r"   r   ro   ZFuture.cancelf  s}     ___{{w11 _ {{y*@AA _ $DKOO&&(  	  _s   B!B!"%B!!B1	c                s    V P                   ;_uu_ 4        V P                  \        \        39   uuR R R 4       #   + '       g   i     R # ; ir   )rL   rS   r   r   r    r"   r   r   ZFuture.cancelledy  s)    ___;;9.D"EE ___s	   9A
	c                s    V P                   ;_uu_ 4        V P                  \        8H  uuR R R 4       #   + '       g   i     R # ; ir   )rL   rS   r   r    r"   r   r   ZFuture.running~  s#    ___;;') ___s	   3A	c                s    V P                   ;_uu_ 4        V P                  \        \        \        39   uuR R R 4       #   + '       g   i     R # ; ir   )rL   rS   r   r   r	   r    r"   r   rm   ZFuture.done  s+    ___;;9.Dh"OO ___s	   >A	c                s^    V P                   e    V P                   hV P                  #   R p i ; ir   )rs   rr   r    r"   r   Z__get_resultZFuture.__get_result  s0    ??&oo%
 << s   ( ,c                sV   V P                   ;_uu_ 4        V P                  \        \        \        39  d'   V P
                  P                  V4        R R R 4       R #  R R R 4        V! V 4       R #   + '       g   i     L; i  \         d    \        P                  RT 4        R # i ; i)Nru   )
rL   rS   r   r   r	   rt   r&   rv   rw   rl   )r!   fnr)   r   add_done_callbackZFuture.add_done_callback  s     ___{{9.Dh"OO$$++B/ _O 	HtH _  	H@$G	Hs   =A0&B 0B 	!B('B(Nc                s    V P                   ;_uu_ 4        V P                  \        \        39   d   \	        4       hV P                  \
        8X  d   V P                  4       uuR R R 4       R p # V P                   P                  V4       V P                  \        \        39   d   \	        4       hV P                  \
        8X  d   V P                  4       uuR R R 4       R p # \        4       h  + '       g   i     M; i R p R #   R p i ; ir   )	rL   rS   r   r   r   r	   _Future__get_resultrf   re   r!   rh   r)   r   rn   ZFuture.result  s     	;;9.D"EE(**[[H,,,.	 !  D $$W-;;9.D"EE(**[[H,,,. !  D '.( !  D4Ds6   D  A
C( 
D  -A$C(
D  
C((C8	3D   Dc                s   V P                   ;_uu_ 4        V P                  \        \        39   d   \	        4       hV P                  \
        8X  d   V P                  uuR R R 4       # V P                   P                  V4       V P                  \        \        39   d   \	        4       hV P                  \
        8X  d   V P                  uuR R R 4       # \        4       h  + '       g   i     R # ; ir   )	rL   rS   r   r   r   r	   rs   rf   re   r   r)   r   rl   ZFuture.exception  s    $ ___{{y*@AA$&&(	 _ OO  ){{y*@AA$&&( _ #n$ __s   AC&A C
CC,	c                s   V P                   ;_uu_ 4        V P                  \        8X  d;   \        V n        V P                   F  pVP                  V 4       K  	   R R R 4       R# V P                  \        8X  d   \        V n         R R R 4       R# \        P                  R\        V 4      V P                  4       \        R4      h  + '       g   i     R # ; i)NFTz!Future %s in unexpected state: %szFuture in unexpected state)rL   rS   r   r   rY   r-   r   r   rw   ZcriticalrJ   RuntimeError)r!   r\   rM   r   set_running_or_notify_cancelZ#Future.set_running_or_notify_cancel  s    . ___{{i'4"mmF((. ,  _ '% _  C "4 $- ##?@@ __s   AC%!C5CC	c                   V P                   ;_uu_ 4        V P                  \        \        \        09   d&   \        R P                  V P                  V 4      4      hWn        \        V n        V P                   F  pVP                  V 4       K  	  V P                   P                  4        RRR4       V P                  4        R#   + '       g   i     L"; iz{}: {!r}N)rL   rS   r   r   r	   r   formatrr   rY   r*   r{   rx   )r!   rn   r\      && r   
set_resultZFuture.set_result  s    
 ___{{y*@(KK'
(9(9$++t(LMM!L"DK--!!$' (OO&&(  	  _   BCC	c                r   r   )rL   rS   r   r   r	   r   r   rs   rY   r,   r{   rx   )r!   rl   r\   r   r   set_exceptionZFuture.set_exception"  s    
 ___{{y*@(KK'
(9(9$++t(LMM'O"DK--$$T* (OO&&(  	  _r   )rL   rt   rs   rr   rS   rY   r   )r   r   r   r   r#   rx   rz   ro   r   r   rm   r~   r}   rn   rl   r   r   r   ZclassmethodtypesZGenericAliasZ__class_getitem__r   r.   r/   r1   r   rq   rq   ?  sf     "L;(&F
*
P
 H(!F%D&AP!! $E$6$67r   rq   c                   sZ   a  ] tR tRt o R tRRR^RR/R ltRRR	/R
 lltR tR tRt	V t
R# )Executori3  c               s    \        4       hr   )ZNotImplementedError)r!   r|   rP   Zkwargss   ""*,r   submitZExecutor.submit6  s     "##r   rh   N	chunksize
buffersizec               s  a aaaaa	a
a Se"   \        S\        4      '       g   \        R4      hSe   S^8  d   \        R4      hSe   S\        P
                  ! 4       ,           o\        V!  oS'       d-   \        P                  ! VV 3R l\        SS4       4       4      o
M$S Uu. uF  pS P                  ! S.VO5!  NK  	  upo
\        P                  ! S 4      o	VVV	VV
VV3R lpV! 4       # u upi )Nz%buffersize must be an integer or Nonezbuffersize must be None or > 0c              3   sL   <"   T F  pSP                   ! S.VO5!  x  K  	  R # 5ir   )r   )rU   rP   r|   r!   s   & r   rW   ZExecutor.map.<locals>.<genexpr>f  s&      #3W4B&&&3Ws   !$c               3   s   <"    SP                  4        S'       d   S'       dG   S! 4       ;p '       d8   \        S	R 4      ;p'       d$   SP                  V P                  ! S.VO5!  4       Sf   \	        SP                  4       4      x  Kw  \	        SP                  4       S\        P                  ! 4       ,
          4      x  K   S F  pVP                  4        K  	  R #   S F  pTP                  4        K  	  i ; i5ir   )	rg   ZnextZ
appendleftr   rp   r_   rb   rc   ro   )
ZexecutorrP   r(   r   ri   executor_weakrefr|   rZ   rh   zipped_iterabless
      r   result_iteratorZ%Executor.map.<locals>.result_iteratorr  s     $

")9);;X;%)*:D%AATAhoob&@4&@A/99/(T^^EU:UVV  !FMMO !bFMMO !s,   C>C  C  C  BC  C> C;;C>)Z
isinstanceZintZ	TypeErrorrX   rb   rc   ZzipcollectionsZdequer    r   weakrefZref)r!   r|   rh   r   r   Z	iterablesrP   r   ri   r   rZ   r   s   ffd$d*  @@@@r   mapZExecutor.mapA  s    6 !*Z*E*ECDD!j1n=>>!11H	?"" #39:JJ3W# B 6FF5ET$++b(4(5EFB #;;t,	$ 	$&   7 Gs   %C.cancel_futuresFc               s    R # r   r   )r!   rf   r   s   &&$r   shutdownZExecutor.shutdown  s     	r   c                s    V # r   r   r    r"   r   rN   ZExecutor.__enter__  s    r   c                s*    V P                  R R7       R# )T)rf   F)r   )r!   Zexc_typeZexc_valZexc_tbs   &&&&r   rQ   ZExecutor.__exit__  s    4 r   r   )T)r   r   r   r   r   r   r   rN   rQ   r   r.   r/   r1   r   r   r   3  sD     	$D!$ D!! D! D!LE   r   r   c                   s    ] tR tRtRtR# )BrokenExecutori  r   Nr   r   r   r   r   r     s    r   r   r   )+Z
__author__r   Zloggingr   rb   r   r   Z	itertoolsr    r   r   r   r   r   r   r   r   r	   ry   Z	getLoggerrw   rv   r   r   re   r   Zobjectr   r2   r@   rC   rI   r]   ra   rj   Z
namedtuplerk   rf   rp   rq   r   r   r   r   r   r   <module>r      sP   2
       ## 
	1  YY{Kj  
		/	0	I 		U 	 	 	-f - ,G (' (<(f (,,<*| $..2 } 02fr8V r8hiv iX\ r   