+
    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t^ RI	t	^ RIH
t
 ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ]P&                  ! ^4      P(                  tR.R
 ltR.R lt ! R R ]P0                  4      t]t ^ RIt]P2                  ;ttR t]P                   P>                  t]P                   P@                  t ]P                   PB                  t!RRR]!/R lt"R t#R t$R t%R t& ! R R4      t'RR/R lt(]PR                  R 4       t*R.R lt+RR/R lt, ! R R]PZ                  4      t.RR/R  lt/R! t0R" t1R# t2R$ t3]3! ]4      t4]	Pj                  ! 4       t6]7! 4       t8/ t9R% t:R& t;R' t<R( t=R) t>R* t?R+ t@]tA]:tB];tC]?tD]@tE]<tF]=tG]>tH]tI ^ R,IH:t:H;t;H?t?H@t@H<t<H=t=H>t>HtHt ]tJ]:tK];tL]?tM]@tN]<tO]=tP]>tQ]tRR#   ] d     EL/i ; i  ] d     R# i ; i)/TaskN)GenericAlias)
base_tasks)
coroutines)events)
exceptions)futures)queues)timeoutsc                 s^    V f   \         P                  ! 4       p \        P                  V 4      # N)r   get_running_loop_current_tasksgetloop   &&/usr/lib64/python3.14/asyncio/tasks.pycurrent_taskr   %   s&    |&&(d##    c                 s   V f   \         P                  ! 4       p \        \        4      p\        P
                  ! \        V4       Uu0 uF9  p\        P                  ! V4      V J g   K  VP                  4       '       d   K7  VkK;  	  up# u upi r	   )
r   r
   Zlist_eager_tasks	itertoolsZchain_scheduled_tasksr   	_get_loopdone)r   Zeager_tasksZt   &  r   	all_tasksr   ,   su    |&&( |$K '7E >E!  #t+ 45FFH AE > > >s   B'B?Bc                   s   a a ] tR t^8t oRtRRRRRRRR/V 3R lltV 3R	 lt]! ]4      t	R
 t
R tR tR tR tR tR tRR/R ltRRRR/R ltRR ltR tR tR tRR ltV 3R ltR tRtVtV ;t# )r    Tr   Nnamecontexteager_startFc               s  < \         SV `  VR 7       V P                  '       d   V P                  R \        P                  ! V4      '       g   RV n        \        RV: 24      hVf   R\        4        2V n        M\        V4      V n        ^ V n
        RV n        RV n        Wn        Vf   \        P                  ! 4       V n        MW@n        V'       d3   V P"                  P%                  4       '       d   V P'                  4        R# V P"                  P)                  V P*                  V P                   R7       \-        V 4       R# )r   Fza coroutine was expected, got NzTask-r   i)super__init___source_tracebackr   iscoroutine_log_destroy_pending	TypeError_task_name_counter_namestr_num_cancels_requested_must_cancel_fut_waiter_corocontextvarsZcopy_context_context_loopZ
is_running_Task__eager_start	call_soon_Task__step_py_register_task)selfcoror   r   r   r   	__class__s   &&$$$$r   r   ZTask.__init__T   s    d#!!!&&r*%%d++ ).D%<THEFF< !3!5 67DJTDJ&'#!
?'446DM#M4::0022 JJ  dmm Dd#r   c                s
  < V P                   \        P                  8X  dU   V P                  '       dC   R V RR/pV P                  '       d   V P                  VR&   V P
                  P                  V4       \        SV `!  4        R# )taskmessagez%Task was destroyed but it is pending!source_tracebackN)	Z_stater   Z_PENDINGr"   r    r-   call_exception_handlerr   __del__)r2   r   r4      & r   r9   ZTask.__del__s   sm    ;;'***t/H/H/HBG %%%.2.D.D*+JJ--g6r   c                s.    \         P                  ! V 4      # r	   )r   Z
_task_reprr2   r   r   __repr__ZTask.__repr__   s    $$T**r   c                    V P                   # r	   )r*   r;   r   r   get_coroZTask.get_coro       zzr   c                r=   r	   )r,   r;   r   r   get_contextZTask.get_context   s    }}r   c                r=   r	   )r%   r;   r   r   get_nameZTask.get_name   r?   r   c                s&    \        V4      V n        R # r	   )r&   r%   )r2   value   &&r   set_nameZTask.set_name   s    Z
r   c                    \        R 4      h)z*Task does not support set_result operationRuntimeError)r2   resultrC   r   
set_resultZTask.set_result   s    GHHr   c                rE   )z-Task does not support set_exception operationrF   )r2   	exceptionrC   r   set_exceptionZTask.set_exception   s    JKKr   limitc               s.    \         P                  ! W4      # r	   )r   Z_task_get_stack)r2   rL      &$r   	get_stackZTask.get_stack   s    * ))$66r   filec               s0    \         P                  ! WV4      # r	   )r   Z_task_print_stack)r2   rL   rO   s   &$$r   print_stackZTask.print_stack   s     ++D>>r   c                s    R V n         V P                  4       '       d   R # V ;P                  ^,          un        V P                  e%   V P                  P	                  VR7      '       d   R# RV n        Wn        R# FmsgT)_log_tracebackr   r'   r)   cancelr(   _cancel_message)r2   rS   rC   r   rU   ZTask.cancel   si    , $99;;##q(# '&&3&//  "r   c                r=   r	   )r'   r;   r   r   
cancellingZTask.cancelling   s     ***r   c                s    V P                   ^ 8  d2   V ;P                   ^,          un         V P                   ^ 8X  d   RV n        V P                   # )    F)r'   r(   r;   r   r   uncancelZTask.uncancel   sE     &&*''1,'**a/$)!***r   c                s   \        V P                  V 4      p \        V 4        V P                  P	                  V P
                  R 4       \        V 4         \        V P                  V4      pV P                  4       '       d   R V n        R p R # \        V 4       R #   \        T 4       i ; i  T P                  4       '       d   R T n        R p i \        T 4       i ; i   \        T P                  T4      pT P                  4       '       d   R T n        R p i \        T 4       i   T P                  4       '       d   R T n        R p i \        T 4       i ; i; ir	   )
_py_swap_current_taskr-   _py_register_eager_taskr,   Zrun!_Task__step_run_and_handle_result_py_unregister_eager_taskr   r*   r1   )r2   	prev_taskZcurtaskr   r   Z__eager_startZTask.__eager_start   s   )$**d;		,#D)0!!$"C"CTJ)$/,/

IF 99;;!%DJD%d+ *$/ 99;;!%DJD%d+,/

IF 99;;!%DJD%d+	 99;;!%DJD%d+sF   C &B 
C B+ B((C +-CED3,E-EEc                s   V P                  4       '       d   \        P                  ! R V : RV: 24      hV P                  '       d8   \	        V\        P
                  4      '       g   V P                  4       pRV n        RV n        \        V P                  V 4        V P                  V4       \        V P                  V 4       Rp R#   \        T P                  T 4       Rp i ; i)z__step(): already done: z, FN)r   r   ZInvalidStateErrorr(   Z
isinstanceCancelledError_make_cancelled_errorr)   _py_enter_taskr-   r\   _py_leave_task)r2   excrC   r   Z__stepZTask.__step
  s    99;;..*4("SG<> >c:#<#<==002 %Dtzz4(	--c24::t,D 4::t,Ds   C C!c                s6  < V P                   p Vf   VP                  R 4      pMVP                  V4      p\        VRR 4      pVEe   \        P
                  ! V4      V P                  JdH   \        RV : RV: R24      pV P                  P                  V P                  WPP                  R7       EMV'       d   W0J dC   \        RV : 24      pV P                  P                  V P                  WPP                  R7       EM\        P                  ! W04       RVn        VP                  V P                  V P                  R7       W0n        V P                   '       d4   V P                  P#                  V P$                  R7      '       d   RV n        EM\        R	V : R
V: 24      pV P                  P                  V P                  WPP                  R7       MVf3   V P                  P                  V P                  V P                  R7       M\&        P(                  ! V4      '       dF   \        RV : R
V: 24      pV P                  P                  V P                  WPP                  R7       MA\        RV: 24      pV P                  P                  V P                  WPP                  R7        R p R #   \*         d\   pT P                   '       d'   RT n        \,        ST `E  T P$                  R7        R p?LG\,        ST `]  TP0                  4        R p?LeR p?i\2        P4                   d   pYn        \,        ST `E  4         R p?LR p?i\8        \:        3 d   p\,        ST `y  T4       h R p?i\>         d   p\,        ST `y  T4        R p?LR p?ii ; i  R p i ; i)N_asyncio_future_blockingzTask z got Future z attached to a different loopr   zTask cannot await on itself: FrR   z-yield was used instead of yield from in task z with z;yield was used instead of yield from for generator in task zTask got bad yield: ) r*   ZsendZthrowZgetattrr   r   r-   rG   r/   r0   r,   future_add_to_awaited_byrd   add_done_callback_Task__wakeupr)   r(   rU   rV   inspectZisgeneratorStopIterationr   rI   rB   r   r_   _cancelled_excKeyboardInterrupt
SystemExitrK   BaseException)r2   rc   r3   rH   ZblockingZnew_excr4   s   &&    r   Z__step_run_and_handle_resultZ!Task.__step_run_and_handle_result  s    zzH	{ 4C$ v'A4HH#$$V,DJJ>*x|!*$ACDG JJ((Wmm ) E~".;D8D#F

,, KK-- - I  88F:?700 MM4== 1 B+1(,,,#//66(,(<(<  7  >  >49 1*##'(&
<=G JJ((Wmm ) E 

$$T[[$--$H$$V,,&))-vjBC 

$$KK-- % A ')=fZ'HI

$$KK-- % A DC  	.   $)!4#7#788"399--(( 	"%GN!:. 	G!#& 	'G!#&&	'f Ds   'J4 BN ;CN 
BN *BN 4N?3L2N 7LN N,N-MN NNM**N7N8NN NN Nc                s    \         P                  ! W4        VP                  4        V P                  4        R p R #   \         d   pT P                  T4        R p?R p R # R p?ii ; ir	   )r   future_discard_from_awaited_byrH   r0   rm   )r2   futurerc      && r   Z__wakeupZTask.__wakeupg  sV    ..v<	MMO KKM  	KK 	s   < A%A  A%)
rV   rj   r,   r*   r)   r"   rT   r(   r%   r'   r	   )__name__
__module____qualname____firstlineno__r"   r   r9   Zclassmethodr   Z__class_getitem__r<   r>   r@   rA   rD   rI   rK   rN   rP   rU   rW   rY   r.   r0   r\   rg   __static_attributes____classdictcell____classcell__r4   __classdict__   @@r   r    r    8   s     4  $T $ $d $"$>	 $L1+ IL7 7.	?4 	?d 	?(T++,&"JX r   c                 sR    \         P                  ! 4       pVP                  ! V 3/ VB # r	   )r   r
   create_task)r3   kwargsr   s   &, r   r{   r{     s(    
 ""$DD+F++r   timeoutreturn_whenc                s   "   \         P                  ! V 4      '       g   \        P                  ! V 4      '       d"   \	        R \        V 4      P                   24      hV '       g   \        R4      hV\        \        \        39  d   \        RV 24      h\        V 4      p \        ;QJ d    R V  4       F  '       g   K   RM	  RM! R V  4       4      '       d   \	        R4      h\        P                  ! 4       p\        WW#4      G Rj  xL
 #  L5i)zexpect a list of futures, not zSet of Tasks/Futures is empty.zInvalid return_when value: c              3   sN   "   T F  p\         P                  ! V4      x  K  	  R # 5ir	   )r   r!   )Z.0f   & r   Z	<genexpr>Zwait.<locals>.<genexpr>  s     
1b:!!!$$bs   #%TFz6Passing coroutines is forbidden, use tasks explicitly.N)r   isfuturer   r!   r#   typerq   
ValueErrorFIRST_COMPLETEDFIRST_EXCEPTIONALL_COMPLETEDsetZanyr   r
   _wait)fsr}   r~   r   s   &$$ r   waitr     s      z55b998b9J9J8KLMM9::?O]KK6{mDEE	RB
s
1b
1sss
1b
111PQQ""$DrK6666s)   8D(D$AD=D/DDDc                 sX    V P                  4       '       g   V P                  R 4       R # R # r	   )r   rI   )waiterZargss   &*r   _release_waiterr     s     ;;==$ r   c                 s  "   Ve]   V^ 8:  dV   \        V 4      p V P                  4       '       d   V P                  4       # \        V 4      G R j  xL
   V P                  4       # \        P                  ! V4      ;_uu_4       GR j  xL
  V G R j  xL
 uuR R R 4      GR j  xL
  #  LX  \        P
                   d   p\        ThR p?ii ; i LF L> L/  + GR j  xL 
 '       g   i     R # ; i5ir	   )	ensure_futurer   rH   _cancel_and_waitr   r_   TimeoutErrorr   r}   )futr}   rc   rp   r   wait_forr     s     F w!|C 88::::<s###	(::< (((y )(( 	$ (( 	(C'	( ) )(((s   AC/B&C/B( "#C/CC/	CCCC/ C!C/(C	=CC		C/CC/C,	C
C,	$C,	&	C/c                 s  aaa	a
a"   VP                  4       oR o
Ve   VP                  V\        S4      o
\        V 4      o\	        4       o	VV	VV
V3R lpV  F+  pVP                  V4       \        P                  ! VS	4       K-  	   SG R j  xL
  S
e   S
P                  4        V  F  pVP                  V4       K  	  \        4       \        4       rvV  F=  pVP                  4       '       d   VP                  V4       K,  VP                  V4       K?  	  Wg3#  L  S
e   S
P                  4        T  F  pTP                  T4       K  	  i ; i5i)Nc                 sH  < S^,          oS^ 8:  g?   S\         8X  g4   S\        8X  dd   V P                  4       '       gN   V P                  4       e<   Se   SP	                  4        SP                  4       '       g   SP                  R4       \        P                  ! V S4       R#    N)	r   r   	cancelledrJ   rU   r   rI   r   rn   )r   countercur_taskr~   timeout_handler   s   &r   _on_completionZ_wait.<locals>._on_completion  st    1qL?*?*AKKMM010I)%%';;==!!$'..q(;r   )create_future
call_laterr   lenr   rf   r   re   rU   remove_done_callbackr   r   add)r   r}   r~   r   r   r   r   Zpendingr   r   r   r   s   &&f&    @@@@r   r   r     s     !FN/6J"gG~H< < 	N+((H5 3%!!#A"">2  E35'6688HHQKKKN	 
 = 	%!!#A"">2 s1   A>ED DD BED 0E		Ec                 s8  "   \         P                  ! 4       pVP                  4       p\        P                  ! \
        V4      pV P                  V4        V P                  4        VG R j  xL
  V P                  V4       R #  L  T P                  T4       i ; i5ir	   )	r   r
   r   	functoolsZpartialr   rf   rU   r   )r   r   r   Zcbs   &   r   r   r     s|      ""$D!F			?F	3B"%

   $ 	  $s0   ABB *B+B /BB BBc                   sT   a  ] tR tRt o R tR tR tR tR tR t	R t
RR	 ltR
tV tR# )_AsCompletedIteratori*  c                s   \         P                  ! 4       V n        R V n        \        P
                  ! 4       p\        V4       Uu0 uF  p\        WCR7      kK  	  ppV F  pVP                  V P                  4       K   	  V'       d%   Ve!   VP                  W P                  4      V n        WPn        \        V4      V n        R # u upi )Nr   )r   ZQueue_done_timeout_handler   get_event_loopr   r   rf   _handle_completionr   _handle_timeout_todor   
_todo_left)r2   Zawsr}   r   ZawZtodor   s   &&&    r   r   Z_AsCompletedIterator.__init__1  s    \\^
#$$&7:3x@xb,x@A 7 78 G')=)=>   
d) As   Cc                    V # r	    r;   r   r   	__aiter__Z_AsCompletedIterator.__aiter__@      r   c                r   r	   r   r;   r   r   __iter__Z_AsCompletedIterator.__iter__C  r   r   c                s   "   V P                   '       g   \        hV ;P                   ^,          un         V P                  4       G Rj  xL
 #  L5ir   )r   ZStopAsyncIteration_wait_for_oner;   r   r   	__anext__Z_AsCompletedIterator.__anext__F  s7     $$1''))))s   AAAAc                s    V P                   '       g   \        hV ;P                   ^,          un         V P                  RR7      # )r   T)resolve)r   ri   r   r;   r   r   __next__Z_AsCompletedIterator.__next__M  s3    1!!$!//r   c                s    V P                    F9  pVP                  V P                  4       V P                  P	                  R 4       K;  	  V P                   P                  4        R # r	   )r   r   r   r   
put_nowaitZclearr2   r   r   r   r   Z$_AsCompletedIterator._handle_timeoutT  sH    A""4#:#:;JJ!!$'  	

r   c                s   V P                   '       g   R # V P                   P                  V4       V P                  P                  V4       V P                   '       g-   V P                  e   V P                  P                  4        R # R # R # r	   )r   Zremover   r   r   rU   r   rC   r   r   Z'_AsCompletedIterator._handle_completionZ  s_    zzz

!

a zzzd22>  '') ?zr   c                s   "   V P                   P                  4       G R j  xL
 pVf   \        P                  hV'       d   VP	                  4       # T#  L25ir	   )r   r   r   r   rH   )r2   r   r   rp   r   r   Z"_AsCompletedIterator._wait_for_oneb  sC      **..""9)))$qxxz+!+	 #s   AAAA)r   r   r   r   N)F)rq   rr   rs   rt   r   r   r   r   r   r   r   r   ru   rv   )ry   s   @r   r   r   *  s2     $*0*, ,r   r   c                s    \         P                  ! V 4      '       d"   \        R \        V 4      P                   24      h\        W4      # )z'expects an iterable of awaitables, not )rh   isawaitabler#   r   rq   r   )r   r}   rM   r   as_completedr   m  sE    \ 25d2h6G6G5HI
 	
  ,,r   c               #   s   "   R x  R # 5ir	   r   r   r   r   __sleep0r     s
      
s   	c                 s  "   V ^ 8:  d   \        4       G Rj  xL
  V# \        P                  ! V 4      '       d   \        R4      h\        P
                  ! 4       pVP                  4       pVP                  V \        P                  W14      p VG Rj  xL
 VP                  4        #  L L  TP                  4        i ; i5i)rX   Nz!Invalid delay: NaN (not a number))r   mathZisnanr   r   r
   r   r   r   Z_set_result_unless_cancelledrU   )ZdelayrH   r   ro   Zhs   &&   r   sleepr     s     zjzz%<==""$D!F<<	(A|	
 	 	
s?   B?B&!B?AB?B* B(B* B?(B* *B<<B?r   c                s   \         P                  ! V 4      '       d,   Ve&   V\         P                  ! V 4      Jd   \        R4      hV # Rp\        P
                  ! V 4      '       g6   \        P                  ! V 4      '       d   R pV! V 4      p RpM\        R4      hVf   \        P                  ! 4       p VP                  V 4      #   \         d    T'       d   T P                  4        h i ; i)NzRThe future belongs to a different loop than the one specified as the loop argumentTc                 s"   "   V G R j  xL
 #  L5ir	   r   )Z	awaitabler   r   _wrap_awaitableZ&ensure_future.<locals>._wrap_awaitable  s     &&s   Fz:An asyncio.Future, a coroutine or an awaitable is required)r   r   r   r   r   r!   rh   r   r#   r   r   r{   rG   Zclose)Zcoro_or_futurer   Zshould_closer   s   &$  r   r   r     s    
 ''G,=,=n,M M E F FL!!.11~..' -^<N L * + + |$$&//   "s   5C C+C+c                   s<   a a ] tR tRt oV 3R ltRR ltRtVtV ;t# )_GatheringFuturei  c               sB   < \         SV `  VR 7       Wn        RV n        R# )r   FN)r   r   	_children_cancel_requested)r2   childrenr   r4   s   &&$r   r   Z_GatheringFuture.__init__  s     d#!!&r   c                s    V P                  4       '       d   R # R pV P                   F  pVP                  VR7      '       g   K  RpK!  	  V'       d   RV n        V# rQ   )r   r   rU   r   )r2   rS   ZretZchilds   &&  r   rU   Z_GatheringFuture.cancel  sM    99;;^^E|||$$ $  &*D"
r   )r   r   r	   )	rq   rr   rs   rt   r   rU   ru   rv   rw   rx   rz   r   r   r     s     ' r   r   return_exceptionsFc                 s  a a	a
aa V'       g9   \         P                  ! 4       pVP                  4       oSP                  . 4       S# \         P                  ! 4       pVe   \        V4      pMR pV3V	V
VVV 3R llp/ p. o	^ o^ o
. pR oV F  pWu9  d   \        WrR7      pVf   \        P                  ! V4      pWJd   RVn	        S^,          oWV&   VP                  4       '       d   VP                  V4       M4Ve   \        P                  ! W4       VP                  V4       MWW,          pS	P                  V4       K  	  \        S	VR7      oV F  pV! V4       K  	  S# )Nc                 sN  < S^,          oVe   \         P                  ! W4       Se   SP                  4       '       d)   V P                  4       '       g   V P	                  4        R# S	'       ga   V P                  4       '       d$   V P                  4       pSP                  V4       R# V P	                  4       pVe   SP                  V4       R# SS8X  d   . pS F  p V P                  4       '       d2   \        P                  ! V P                  f   RMV P                  4      pM$V P	                  4       pVf   V P                  4       pVP                  V4       K  	  SP                  '       d$   V P                  4       pSP                  V4       R# SP                  V4       R# R# )r   N )r   rn   r   r   rJ   r`   rK   r   r_   rV   rH   appendr   rI   )
r   r   rc   ZresultsZresr   	nfinishednfutsouterr   s
   &&   r   _done_callbackZgather.<locals>._done_callback*  sK   Q	223A=EJJLL==?? }} //1##C(mmo?'', G==?? %33!119++-C --/C{!jjls#  " &&& //1##C(  ); r   r   F)r   r   r   rI   Z_get_running_loopr   r   r   r   r"   r   r   re   rf   r   )r   Zcoros_or_futuresr   r   r   Z
arg_to_futZ	done_futsargr   r   r   r   r   s   d*       @@@@r   gatherr      sM   < $$&""$##%D%%- 8* 8*t JHEIIE /C|((-~
 ,1(QJE!sOxxzz  %'44SC%%n5 /C1  4 XD1E s Lr   c                 s   V P                  4       '       d   R # V P                  4       pVf   R # RVP                  P                   R2RVRV /pV P                  '       d   V P                  VR&   V P
                  P                  V4       R # )Nr6   z exception in shielded futurerJ   ro   r7   )r   rJ   r4   rq   r    r-   r8   )r   rc   r   r   r   _log_on_exceptionr     s    
}}
--/C
{ 	==!!
""?@S#	G &)&;&;"#II$$W-r   c                 s  aaaa \        V 4      oSP                  4       '       d   S# \        P                  ! S4      pVP	                  4       oVe(   \        V4      ;oe   \        P                  ! SS4       MR oV3R lpV3R loVV3R lpSe   SP                  V4       SP                  S4       SP                  V4       S# )Nc                 s6   < \         P                  ! V S4       R # r	   )r   rn   )innerr   s   &r   _clear_awaited_by_callbackZ*shield.<locals>._clear_awaited_by_callback  s    ..uh?r   c                 s  < SP                  4       '       d   R # V P                  4       '       d   SP                  4        R # V P                  4       pVe   SP                  V4       R # SP	                  V P                  4       4       R # r	   )r   rU   rJ   rK   rI   rH   )r   rc   r   r:   r   _inner_done_callbackZ$shield.<locals>._inner_done_callback  s\    ????LLN//#C##C(  0r   c                 s   < SP                  4       '       g>   SP                  S4       SP                  \        4       SP                  \        4       R # R # r	   )r   r   r   rf   )r   r   r   s   &r   _outer_done_callbackZ$shield.<locals>._outer_done_callback  s@    zz||&&';<&&'89##$56	 r   )r   r   r   r   r   r   re   rf   )r   r   r   r   r   r   r   r   s   &   @@@@r   shieldr     s    B #Ezz||U#D Ed);;XH((9@17  :; 
01	01Lr   c                 s   a aa \         P                  ! S 4      '       g   \        R 4      h\        P                  P                  4       oV VV3R lpSP                  V4       S# )zA coroutine object is requiredc                  s   <  \         P                  ! \        SSR 7      S4       R#   \        \        3 d    h \
         d.   p SP                  4       '       d   SP                  T 4       h Rp ? ii ; i)r   N)r   Z_chain_futurer   rl   rk   rm   Zset_running_or_notify_cancelrK   )rc   r3   ro   r   s    r   callbackZ*run_coroutine_threadsafe.<locals>.callback  s`    	!!-4"@&I-. 	 	2244$$S)	s   "' A0A0(A++A0)r   r!   r#   
concurrentr   FutureZcall_soon_threadsafe)r3   r   r   ro   s   ff @r   run_coroutine_threadsafer     sP    
 !!$''899&&(F 	h'Mr   c                 s   a  R R/V 3R llpV# )r   Tc                s   < S! V3R V RV/VB # )r   r   r   )r   r3   r   r|   custom_task_constructors   &&$,r   factoryZ*create_eager_task_factory.<locals>.factory  s0    &@@)4@8>@ 	@r   r   )r   r   s   f r   create_eager_task_factoryr     s    &@4 @ Nr   c                 0    \         P                  V 4       R # r	   )r   r   r5   r   r   _register_taskr   .  s    r   c                 r   r	   )r   r   r   r   r   _register_eager_taskr   3  s    Tr   c                 sr    \         P                  V 4      pVe   \        RV: RV: R24      hV\         V &   R # )NzCannot enter into task z while another task z is being executed.r   r   rG   r   r5   r   rp   r   _enter_taskr   8  sL    !%%d+L4TH =##/"22EG H 	HN4r   c                 sp    \         P                  V 4      pW!Jd   \        R V: RV: R24      h\         V  R# )zLeaving task z! does not match the current task Z.Nr   r   rp   r   _leave_taskr   @  sH    !%%d+L]4( 3//;.>aA B 	Btr   c                 s\    \         P                  V 4      pVf
   \         V  V# V\         V &   V# r	   )r   r   )r   r5   r^   rp   r   _swap_current_taskr   H  s9    ""4(I|4    $tr   c                 r   r	   )r   discardr   r   r   _unregister_taskr   Q  s    T"r   c                 r   r	   )r   r   r   r   r   _unregister_eager_taskr   V  s    r   )	r   r   r   r   r   r   r   r   r   )r    r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   eager_task_factoryr   r   r   r   r	   )SZ__all__Zconcurrent.futuresr   r+   r   rh   r   r   ZtypesZweakrefr   r   r   r   r   r   r   r   r   Zcountr   r$   r   r   Z	_PyFuturer    Z_PyTaskZ_asyncioZ_CTaskZImportErrorr{   r   r   r   r   r   r   r   r   r   r   Z	coroutiner   r   r   r   r   r   r   r   r   r   r   ZWeakSetr   r   r   r   r   r   r   r   r   r   r   Z_py_current_taskr1   r[   Z_py_unregister_taskr]   ra   rb   rZ   Z_py_all_tasksZ_c_current_taskZ_c_register_taskZ_c_register_eager_taskZ_c_unregister_taskZ_c_unregister_eager_taskZ_c_enter_taskZ_c_leave_taskZ_c_swap_current_taskZ_c_all_tasksr   r   r   <module>r      sb                  
 __Q'00 $	>~7 ~B
 "
 MM!D6, $$44$$44""007d 7 7< 
0d,^%"@, @,F3- 3-l 
 
($ @w~~ :L L^.&JZ.4 /t4  ??$ u 

 #

   " . & 2 * 3 3 3 #O%1)5MM-Lo  		X  		s$   G G GGG! G!