
    ,i                       U d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZ d dlmZmZmZ d dlZd dlZddlmZmZmZ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!m"Z"m#Z#m$Z$m%Z%m&Z& dd
l'm(Z( erd dl)m*Z*m+Z+m,Z, d dl-m.Z. ddl/m0Z0 e1e2e3ejh                  e5e6   z  f      Z7 ed      Z8d@dZ9d@dZ:d@dZ;d@dZ<d@dZ=dAdBdZ>d@dZ?d@dZ@d@dZAd@dZB	 	 	 	 	 	 dCdZCej                  j                  dg d      ej                  j                  dddg      ej                  j                  dddg      	 	 	 	 	 	 	 	 dDd                      ZFd@d!ZGd@d"ZH	 	 	 	 dEd#ZId@d$ZJd@d%ZK ej                  d&      ZMd'eNd&<   d@d(ZOd@d)ZPd@d*ZQd@d+ZRd@d,ZSd@d-ZTd@d.ZUd@d/ZVd@d0ZWd@d1ZXd@d2ZYd@d3ZZd@d4Z[d@d5Z\d@d6Z]d@d7Z^	 	 	 	 	 	 	 	 	 	 dFd8Z_ej                  j                  d9ddg      dGd:       Z`d@d;Zad@d<Zbed@d=       Zcd@d>Zdd@d?Zey)H    )annotationsNpartial)TYPE_CHECKINGNoReturnTypeVar   )CancelScopeCapacityLimiterEvent_core
fail_aftermove_on_aftersleepsleep_forever)ki_self)slow)active_thread_countcurrent_default_thread_limiterfrom_thread_check_cancelledfrom_thread_runfrom_thread_run_syncto_thread_run_syncwait_all_threads_completed)wait_all_tasks_blocked)AsyncGenerator	AwaitableCallable)Outcome)TaskTc                   K   t        j                         	 d
	 	 	 	 	 	 	 	 	 dfd} t        j                         }dd} | t        |d|       d {    dd} | t        |dt
        f|       d {    dd} | t        |d|       d {    dd	} | t        |dt        f|       d {    y 7 e7 E7 +7 w)Nc                   K   g d fd}t        j                  |d      }|j                          |j                         r/t	        d       t        d       d {    |j                         r/d|fdf|gk(  sJ y 7 $w)	Nc                    	 j                  dt        j                         f              } j                  d| f       y # t        $ r1}t	        |       j                  dt        |      f       Y d }~y d }~ww xY w)Nstart
trio_tokengoterror)append	threadingcurrent_threadBaseExceptionprinttype)xexcdo_in_trio_threadfnrecordr'   s     g/var/www/system.tvplus.app.br/jogos/scrap/venv/lib/python3.12/site-packages/trio/_tests/test_threads.pythreadfnz<test_do_in_trio_thread.<locals>.check_case.<locals>.threadfnA   so    4w	(@(@(BCD%b&ZHuaj)  4c
wS	2334s   AA 	B'A<<BT)targetdaemonyawn{Gz?r%   freturnNone)r+   Threadr%   is_aliver.   r   )r2   r3   expectedr'   r6   child_threadr4   trio_threads   `` `  @r5   
check_casez*test_do_in_trio_thread.<locals>.check_case9   s       	4 	4 !''xE##%&M+ ##% 7L1C3ExPPPP s   AB
#B$B
9B
c                z    t        j                         rJ | j                  dt        j                         f       y)Nr;   r	   )r   currently_ki_protectedr*   r+   r,   r4   s    r5   f1z"test_do_in_trio_thread.<locals>.f1S   s1    //111sI44678    )r(   r	   r&   c                    t        j                         rJ | j                  dt        j                         f       t
        Nr;   )r   rF   r*   r+   r,   
ValueErrorrG   s    r5   f2z"test_do_in_trio_thread.<locals>.f2Z   s4    //111sI44678rI   r)   c                   K   t        j                         rJ t        j                          d {    | j                  dt	        j
                         f       y7 *w)Nr;      )r   rF   
checkpointr*   r+   r,   rG   s    r5   f3z"test_do_in_trio_thread.<locals>.f3a   sL     //111   sI44678 	!s   .AA+A)r(   rO   c                   K   t        j                         rJ t        j                          d {    | j                  dt	        j
                         f       t        7 /wrK   )r   rF   rP   r*   r+   r,   KeyErrorrG   s    r5   f4z"test_do_in_trio_thread.<locals>.f4i   sN     //111   sI44678 	!s   .A"A 0A"N)
r2   zCallable[..., threading.Thread]r3   zCallable[..., T | Awaitable[T]]rA   ztuple[str, T]r'   _core.TrioToken | Noner=   r>   )r4   
RecordTyper=   int)r4   rW   r=   r   )r+   r,   r   current_trio_tokenr   rL   r   rS   )rD   tokenrH   rM   rQ   rT   rC   s         @r5   test_do_in_trio_threadr[   6   s     **,K .2	Q:Q+Q  Q +	Q
 
Q0 $$&E
 )2ze
LLL
 )2/DQV
WWW _b*
GGG _b7H*=%
PPP/ M X H QsH   ACB:!C6B<7CB>!C4C 5C<C>C Cc                    K   t        j                  t              5  t        d        d d d        dd} t        j                  t              5  t	        |        d d d        y # 1 sw Y   ;xY w# 1 sw Y   y xY ww)Nc                      y rU    r^   rI   r5   <lambda>z9test_do_in_trio_thread_from_trio_thread.<locals>.<lambda>t       rI   c                    K   y wrU   r^   r^   rI   r5   fooz4test_do_in_trio_thread_from_trio_thread.<locals>.foov   	        r<   )pytestraisesRuntimeErrorr   r   )rb   s    r5   'test_do_in_trio_thread_from_trio_threadrh   r   sc     	|	$ +\*+ 
|	$  + + s3   A;A#%A;A/	A;#A,(A;/A84A;c                 b    t               dfd} t        j                  |        ddhk(  sJ y )Nc                 |  K   t        j                         d	dd	fdd	fd} t        j                  |       }|j	                          t        d       |j                         r$t        d       d {    |j                         r$t        d       |j                          t        d       y 7 <w)
Nc                     t        d       t        j                         rJ t        d       	 t                dd l} t        d | j
                                y # dd l} t        d | j
                                w xY w)Nzin Trio threadr   r   finally)r.   r   rF   r   sysexc_info)rm   s    r5   trio_thread_fnzTtest_run_in_trio_thread_ki.<locals>.check_run_in_trio_thread.<locals>.trio_thread_fn   s]    "#33555)1	i0 i0s   
A !A9c                    K             y wrU   r^   )ro   s   r5   trio_thread_afnzUtest_run_in_trio_thread_ki.<locals>.check_run_in_trio_thread.<locals>.trio_thread_afn   s     s   	c                     	 t        d       t               	 t	               y # t        $ r t        d        j                  d       Y 6w xY w# t        $ r t        d        j                  d       Y y w xY w)Nrunningr&   ok1ok2)r.   r   KeyboardInterruptaddr   )r4   rZ   rq   ro   s   r5   external_thread_fnzXtest_run_in_trio_thread_ki.<locals>.check_run_in_trio_thread.<locals>.external_thread_fn   sp    "i $^F"EB	 % "e

5!"
 % "e

5!"s    * A %AA%A=<A=)r7   waitingr:   zwaited, joiningdoner<   )	r   rY   r+   r?   r%   r.   r@   r   join)rx   threadrZ   rq   ro   r4   s     @@@r5   check_run_in_trio_threadz<test_run_in_trio_thread_ki.<locals>.check_run_in_trio_thread   s     ((*		1		" 	" !!);<ioo+ oo f s   A7B<=B:>B<(B<rt   ru   r<   )setr   run)r}   r4   s    @r5   test_run_in_trio_thread_kir   }   s3     UF%N 
II&'eU^###rI   c                     g t               dfddfddfd} t        j                  |       }|j                          ddgk(  sJ y )	Nc                    K   j                  d        j                          t        j                  d        d {    y 7 w)Nsleepingc                6    t         j                  j                  S rU   )r   Abort	SUCCEEDED)_s    r5   r_   zMtest_await_in_trio_thread_while_main_exits.<locals>.trio_fn.<locals>.<lambda>   s    EKK4I4I rI   )r*   r~   r   wait_task_rescheduled)evr4   s   r5   trio_fnz;test_await_in_trio_thread_while_main_exits.<locals>.trio_fn   s1     j!
))*IJJJs   ;AAAc                v    	 t        |        y # t        j                  $ r j                  d       Y y w xY w)Nr&   	cancelled)r   r   	Cancelledr*   )rZ   r4   r   s    r5   	thread_fnz=test_await_in_trio_thread_while_main_exits.<locals>.thread_fn   s1    	'G6 	'MM+&	's    $88c                    K   t        j                         } t        j                  | f      }|j	                          j                          d {    dgk(  sJ |S 7 w)N)r7   argsr   )r   rY   r+   r?   r%   wait)rZ   r|   r   r4   r   s     r5   mainz8test_await_in_trio_thread_while_main_exits.<locals>.main   sY     ((*!!%Bggi*%%% 	s   AA$A"A$r   r   r<   )rZ   _core.TrioTokenr=   r>   )r=   threading.Thread)r   r   r   r{   )r   r|   r   r4   r   r   s     @@@@r5   *test_await_in_trio_thread_while_main_exitsr      sJ    F	BK
' YYt_F
KKMj+....rI   c                 b  K   d} d| z   fdddfdt               d {    t        d        d {    t         d| z                d {    dfd} |d       d {     |d	       d {     |d
       d {     |d       d {    y 7 |7 i7 O7 ;7 -7 7 w)Nz0 from trio._tests.test_threads.test_named_threadinnerc                p    t        j                         j                  | k(  sJ t        j                         S rU   )r+   r,   name)r   s    r5   r   z test_named_thread.<locals>.inner   s.    '')..$666''))rI   c                    t        |       S rU   r   r   r   s    r5   r;   ztest_named_thread.<locals>.f       ud##rI   thread_namer>   c                   K   t         |       |        d {   }t        j                  d|j                        sJ y 7 'w)Nr   Trio thread [0-9]*)r   rematchr   )r   r|   r;   s     r5   test_thread_namez+test_named_thread.<locals>.test_thread_name   s9     )!D'tDDxx-v{{;;; Es   AA(A fobiedooname_longer_than_15_characters   💙r   strr=   r   r   r   r=   zCallable[[], threading.Thread])r   r   r=   r>   r   )endingr   r;   r   s     @@r5   test_named_threadr      s     ?F!F* *$ U
###
U
555 Qv/
000< 2

:
&&&
;
<<<
6
""" $5 1 &<"sy    B/B!B/B#B/B%B/+B',B/;B)<B/B+B/B-B/#B/%B/'B/)B/+B/-B/c                z   dd l }dd l}|j                  j                  d      }|sd}	 |j	                  |      }t        |dd       }|sJ |j                  |j                  |j                  g|_        |j                  |_        |j!                  dd      }| t#        j$                         }  || |d      dk(  sJ 	 |j&                  j)                         S # t
        $ r t        dt        j                          Y y w xY w# t*        $ r/}t-        j.                  d	|j&                  d
|        Y d }~y d }~ww xY w)Nr   pthreadzlibc.sozno pthread on pthread_getname_nprI      )sizezvalue: z, exception: )ctypesctypes.utilutilfind_libraryCDLL	Exceptionr.   rm   platformgetattrc_void_pc_char_pc_size_targtypesc_intrestypecreate_string_bufferr+   	get_identvaluedecodeUnicodeDecodeErrorre   fail)identr   libpthread_path
libpthreadr   name_bufferes          r5   _get_thread_namer      s>   kk..y9O $[[1

 !-A4H  	#
 "(--c-;K}##%e["5:::E  ''))-  s||n-..  Egk//2-sCDDEs)   C =D %C?>C?	D:%D55D:c                 :  K   dddfdd} t         |              d {    t         |       d        d {    ddfd} |d       d {     |d       d {     |d       d {     |d	d
       d {    y 7 i7 P7 ;7 -7 7 w)Nc                    t               }|Mt        j                  dk7  r:t        j                  dt        j                          t        j                         S || d d k(  sJ t        j                         S )Nlinuxzno pthread OS support on    )r   rm   r   re   skipr+   r,   )r   os_thread_names     r5   r   z#test_named_thread_os.<locals>.inner  si    )+!cllg&=KK3CLL>BC '')) "T#2Y...''))rI   c                    t        |       S rU   r   r   s    r5   r;   ztest_named_thread_os.<locals>.f  r   rI   z4None from trio._tests.test_threads.test_named_threadr   c                   K   || }t         |      |        d {   }t        |j                        }|J d       t        j                  d|      sJ y 7 ;w)Nr   z'should skip earlier if this is the caser   )r   r   r   r   r   )r   rA   r|   r   r;   s       r5   r   z.test_named_thread_os.<locals>.test_thread_name'  s`     H)!H+4HH)&,,7)T+TT)xx-~>>>	 Is   AA<Ar   r   r   r   ?)rA   r   r   rU   )r   r   rA   
str | Noner=   r>   r   )defaultr   r;   r   s     @@r5   test_named_thread_osr     s     *$ EG
QwZ
(((
QwZT
:::? 2

:
&&&
;
<<<
6C
000# ): &<0si   !BBB BBBB'B(B7B8B	B
BBBBBBc                     ddl m}   |        }|<t        j                  dk7  sJ t	        j
                  dt        j                          y y )Nr   )get_os_thread_name_funcr   zno pthread_setname_np on )trio._core._thread_cacher   rm   r   re   r   )r   ks     r5   test_has_pthread_setname_npr   7  sA    @!Ay||w&&&/~>? rI   c                   K   t        j                         } dd}t        |d       d {   \  }}|dk(  sJ || k7  sJ dd}t        j                  t
        d      5 }t        |       d {    d d d        t        j                  j                         |j                  j                  d   | k7  sJ y 7 7 L# 1 sw Y   KxY ww)	Nc                .    | t        j                         fS rU   )r+   r,   )r0   s    r5   r;   z$test_run_in_worker_thread.<locals>.fC  s    9++-..rI      c                 <    t        t        j                               rU   )rL   r+   r,   r^   rI   r5   gz$test_run_in_worker_thread.<locals>.gJ  s    11344rI   z1^<Thread\(Trio thread \d+, started daemon \d+\)>$r   r   )r0   r!   r=   ztuple[T, threading.Thread])r=   r   )	r+   r,   r   re   rf   rL   r.   r   r   )rC   r;   r0   rB   r   excinfos         r5   test_run_in_worker_threadr   @  s     **,K/ /q!44OA|6M6;&&&5 
B
 $ 
 ###	$
 
'--

==a K/// 5 	$	$ $s:   (C	B94C	B=.B;/B=3AC	;B==CC	c                   K   d gdfddfd} g t        j                         }t        j                         4 d {   }|j	                  | |d       t                d {    dgk(  sJ |j                  j                          d d d       d {    d   dk7  sJ |j                  d        d   dk7  rt        j                  d       d   dk7  rg d d<   t        j                         4 d {   }|j	                  | |d       t                d {    |j                  j                          t        j                  d	      5  t        d
      D ]  }t        j                          d {      	 d d d        dgk(  sJ |j                  d        d d d       d {    t        j                         5 }|j                           | |d       d {    d d d        j                  sJ y 7 7 7 q# 1 d {  7  sw Y   xY w7 %7 7 # 1 sw Y   xY w7 # 1 d {  7  sw Y   xY w7 e# 1 sw Y   dxY ww)Nc                :    dd<   | j                          dd<   y )Nblockingr   finished)get)qregisters    r5   r;   z1test_run_in_worker_thread_cancellation.<locals>.fY  s     	 rI   c                   K   j                  d       	 t        | |       d {   j                  d       S 7 # j                  d       w xY wwNr%   abandon_on_cancelexit)r*   r   )r   r   r;   r4   s     r5   childz5test_run_in_worker_thread_cancellation.<locals>.child_  sG     g	"+AqDUVVMM&! WMM&!s%   A? =? A? AATr%   r   r   r:   Fshield
   )r   stdlib_queue.Queue[None]r=   r>   )r   r   r   boolr=   r>   )stdlib_queueQueuer   open_nursery
start_soonr   cancel_scopecancelputtimer   r
   rangerP   cancelled_caught)r   r   nurseryr   scoper;   r4   r   s        @@@r5   &test_run_in_worker_thread_cancellationr  V  s9    "&H!" F"."4"4"6A!!# & &w5!T* %&&&'"""##%& & A;*$$$EE$K
1+
#

4 1+
# FHQK!!# 	 	w5!U+$&&&##%d+ 	)2Y )&&((()	) '"""	d	 	 
			 Auo !!!!I&
 	'& & & &&	& )	) 	)		 	 	 	  	 s  ?IHI!H)H	*&HIHAI!I H%I!H;%H(&4H;&H- H+
H-!H;)I4H95II*I+I/I	HIH"HH"	I(H;+H--H6	2H;9I;III	IIIIc                   |j                  t        j                  dd       t        j                         t        j                         dfddfd}t        j
                  |       j                  d        j                         }|j                         r&t        j                  d       |j                         r&| j                         \  }}d|vsJ d|vsJ y )NIDLE_TIMEOUTr:   c                 l     j                          j                  t        j                                y rU   )r   r   r+   r,   )q1q2s   r5   r   z6test_run_in_worker_thread_abandoned.<locals>.thread_fn  s!    

y'')*rI   c                 $  K   dfd} t        j                         4 d {   }|j                  |        t                d {    |j                  j                          d d d       d {    y 7 R7 17 	# 1 d {  7  sw Y   y xY ww)Nc                 <   K   t         d       d {    y 7 w)NTr   r   )r   s   r5   r   z@test_run_in_worker_thread_abandoned.<locals>.main.<locals>.child  s     $Y$GGGs   r<   )r   r   r   r   r   r   )r   r  r   s     r5   r   z1test_run_in_worker_thread_abandoned.<locals>.main  s|     	H %%' 	* 	*7u%(***  '')	* 	* 	**	* 	* 	* 	*sV   BA5BA;A7A;$B/A90B7A;9B;BBB	BzException in threadr<   )setattrr   _thread_cacher   r   r   r   r   r@   r   r   
readouterr)	capfdmonkeypatchr   r|   outerrr  r	  r   s	         @@@r5   #test_run_in_worker_thread_abandonedr    s     ++^TB#/#5#5#7B/;/A/A/CB+* 
IIdOFF4L VVXF
//


4 //
 !HC +++ +++rI   MAX)rO      r   r   FTuse_default_limiterc                4  
K   d| z  }t        j                         
t        j                         |r t               }|j                  }| |_        d nt        |       }| }|	  G d d      d_        d_        d_        d_	        t        j                         d
fddfd}t        j                         4 d {   }t        d       g }t        |      D ]B  }	|j                  t                      |j!                  ||d          t#                d {    D r8t        d	       |d   j%                          d {    t#                d {    j                  | k7  s|j'                         j(                  | k7  rAt+        d
       d {    j                  | k7  r#|j'                         j(                  | k7  rA
j-                          d d d       d {    j                  | k(  sJ r2|j.                  dkD  r#t+        d
       d {    |j.                  dkD  r#j                  |k(  sJ j                  dk(  sJ 	 ||_        y 7 7 A7 7 7 7 # 1 d {  7  sw Y   xY w7 d# ||_        w xY ww)Nr	   c                  6    e Zd ZU ded<   ded<   ded<   ded<   y)0test_run_in_worker_thread_limiter.<locals>.staterX   ran
high_waterrs   parkedN)__name__
__module____qualname____annotations__r^   rI   r5   stater    s    HOLKrI   r!  r   c                   t        d       t        | j                         5  xj                  dz  c_        xj                  dz  c_        t        j                  j                        _        xj                  dz  c_        d d d        j                          5  xj                  dz  c_        xj                  dz  c_        d d d        t        d       y # 1 sw Y   ZxY w# 1 sw Y   !xY w)Nzthread_fn startr&   r   zthread_fn exiting)	r.   r   r   r  rs   maxr  r  r   )r   gatelockr!  rZ   s    r5   r   z4test_run_in_worker_thread_limiter.<locals>.thread_fn  s    #$ !4!4G "		Q	"#&u'7'7#G  !" IIK #!"# %&" "# #s   A%C$%+C0$C-0C9c                   K   t        j                         5 }t        |       d {    d d d        t        dj                         | j                          y 7 3# 1 sw Y   2xY ww)N)r   limiterzrun_thread finished, cancelled:)r   r
   r   r.   r  r~   )eventr   r   limiter_argr   s     r5   
run_threadz5test_run_in_worker_thread_limiter.<locals>.run_thread  si     ""$ ( &,'	   3\5R5RSIIK s+   A-A!AA!/A-A!!A*&A-spawningz'waiting for first cancellation to clearr:   )r   r
   r=   r>   )r(  r   r=   r>   )r+   r   Lockr   total_tokensr   r  r  rs   r  r   rY   r   r.   r   r*   r   r   r   
statisticstasks_waitingr   r~   borrowed_tokens)r  r   r  COUNTcorig_total_tokensr*  r  eventsr   r$  r)  r%  r!  r   rZ   s    `        @@@@@@r5   !test_run_in_worker_thread_limiterr6    s\     GE??D>>D*,NNC [+	 	 	((*	' 	' 		 %%' 	 	7*F5\ /eg&"":vbz:,.../ ?@Qinn&&&,... #q||~'C'Cs'JDk!! #q||~'C'Cs'J HHJ5	 	8 3&&& ##a'Dk!! ##a' yyE!!!}}!!!*Q	 / '. "1	 	 	 	F "
 +s   AJ)A#J I%J AI5'I(()I5I+I5#I.$>I5"I1#I57I5I5%J 0I314J %J
&J :"J J%J (I5+I5.I51I53J 5J;I><JJ 	JJc                 v   K   g  G fdd      } t        d  |               d {    ddgk(  sJ y 7 w)Nc                  &    e Zd Zd fdZd fdZy)?test_run_in_worker_thread_custom_limiter.<locals>.CustomLimiterc                >   K   j                  d       || _        y wNacquirer*   	_borrowerselfborrowerr4   s     r5   acquire_on_behalf_ofzTtest_run_in_worker_thread_custom_limiter.<locals>.CustomLimiter.acquire_on_behalf_of5  s     MM)$%DNs   c                J    j                  d       || j                  k(  sJ y )Nreleaser=  r?  s     r5   release_on_behalf_ofzTtest_run_in_worker_thread_custom_limiter.<locals>.CustomLimiter.release_on_behalf_of9  s!    MM)$t~~---rI   NrA  r    r=   r>   r  r  r  rB  rE  rG   s   r5   CustomLimiterr9  4  s    	&	.rI   rH  c                      y rU   r^   r^   rI   r5   r_   z:test_run_in_worker_thread_custom_limiter.<locals>.<lambda>?  r`   rI   r'  r<  rD  r   )rH  r4   s    @r5   (test_run_in_worker_thread_custom_limiterrK  /  sE      F. . \=?
CCCi++++ Ds   %979c                   K   g  G fdd      }  |        }t        j                  t        d      5 }t        d |       d {    d d d        j                  j
                  J ddgk(  sJ g i t        j                  t        d      5 }t        fd	|       d {    d d d        t        |j                  j
                  t              sJ ddgk(  sJ y 7 # 1 sw Y   xY w7 J# 1 sw Y   IxY ww)
Nc                  &    e Zd Zd fdZd fdZy)Ctest_run_in_worker_thread_limiter_error.<locals>.BadCapacityLimiterc                0   K   j                  d       y wr;  )r*   r?  s     r5   rB  zXtest_run_in_worker_thread_limiter_error.<locals>.BadCapacityLimiter.acquire_on_behalf_ofG  s     MM)$s   c                <    j                  d       t        d      )NrD  zrelease on behalf)r*   rL   r?  s     r5   rE  zXtest_run_in_worker_thread_limiter_error.<locals>.BadCapacityLimiter.release_on_behalf_ofJ  s    MM)$011rI   NrF  )rA  r    r=   r   rG  rG   s   r5   BadCapacityLimiterrN  F  s    	%	2rI   rQ  z^release on behalf$r   c                      y rU   r^   r^   rI   r5   r_   z9test_run_in_worker_thread_limiter_error.<locals>.<lambda>Q  r`   rI   rJ  r<  rD  c                      d   S )Nr0   r^   )ds   r5   r_   z9test_run_in_worker_thread_limiter_error.<locals>.<lambda>Z  s    3 rI   )re   rf   rL   r   r   __context__
isinstancerS   )rQ  bsr   rT  r4   s      @@r5   'test_run_in_worker_thread_limiter_errorrX  C  s     F2 2 
	B	z)?	@ ;G r:::;==$$,,,i++++F A	z)?	@ =G <<<=gmm//:::i++++ 	;; ; 	== =sY   1DC'C%C'ADC5(C3)C5-8D%C''C0,D3C55C>:Dc                |  K   dd}| j                  t        j                  j                  d|       t	               }|j
                  dk(  sJ t        j                  t              5 }t        d        d {    d d d        dt        j                        v sJ |j
                  dk(  sJ y 7 7# 1 sw Y   6xY ww)Nc                    t        d      )Nz!the engines canna take it captain)rg   )r@  r   s     r5   	bad_startz:test_run_in_worker_thread_fail_to_spawn.<locals>.bad_startc  s    >??rI   start_thread_soonr   c                      y rU   r^   r^   rI   r5   r_   z9test_run_in_worker_thread_fail_to_spawn.<locals>.<lambda>m  r`   rI   engines)r@  objectr   r_  r=   r   )r  r   r  ThreadCacher   r1  re   rf   rg   r   r   r   )r  r[  r'  r   s       r5   'test_run_in_worker_thread_fail_to_spawnra  _  s     @ ++779LiX,.G""a''' 
|	$ / .../GMM****""a''' 	// /s0   A$B<&B06B.7B0;3B<.B00B95B<c                 t   K   dd} t        j                         }t        |        d {   }||k(  sJ y 7 w)Nc                 8    t        t        j                        } | S rU   r   r   rY   callee_tokens    r5   r   z5test_trio_to_thread_run_sync_token.<locals>.thread_fnv      +E,D,DErI   r=   r   r   rY   r   r   caller_tokenrf  s      r5   "test_trio_to_thread_run_sync_tokenrl  s  ;      ++-L+I66L<''' 7   '868c                    K   dd} t        j                  t        d      5  t        |        d {    d d d        y 7 # 1 sw Y   y xY ww)Nc                    K   y wrU   r^   r^   rI   r5   async_fnz=test_trio_to_thread_run_sync_expected_error.<locals>.async_fn  rc   rd   zexpected a sync functionr   r<   )re   rf   	TypeErrorr   rq  s    r5   +test_trio_to_thread_run_sync_expected_errorrt    sG      
y(B	C + ***+ +*+ +s)    AA?A	AAA
Atrio_test_contextvarzcontextvars.ContextVar[str]c                 z  K   t        j                         } t        j                  d       dd}t	        |       d {   \  }}|dk(  sJ || k7  sJ dd}t	        |       d {   \  }}}t        j                         }|dk(  sJ |dk(  sJ |dk(  sJ d       t        j                         dk(  sJ y 7 x7 Rw)	Nr   c                     t         j                         } t        j                  t        j
                        5  t	        j                          d d d        | t        j                         fS # 1 sw Y   xY wrU   )	ru  r   re   rf   sniffioAsyncLibraryNotFoundErrorcurrent_async_libraryr+   r,   )r   s    r5   r;   z3test_trio_to_thread_run_sync_contextvars.<locals>.f  sW    $((*]]7<<= 	,))+	,y//122	, 	,s   A++A4c                 B   t         j                         } t         j                  d       t         j                         }t        j                  t
        j                        5  t        j                          d d d        | |t        j                         fS # 1 sw Y    xY w)Nworker)
ru  r   r~   re   rf   rx  ry  rz  r+   r,   )parent_valueinner_values     r5   r   z3test_trio_to_thread_run_sync_contextvars.<locals>.g  s}    +//1  **..0]]7<<= 	,))+	, $$&
 	
	, 	,s   !BBr|  zRThe contextvar value set on the worker would not propagate back to the main threadtrio)r=   ztuple[str, threading.Thread])r=   z!tuple[str, str, threading.Thread])r+   r,   ru  r~   r   r   rx  rz  )rC   r;   r   rB   r   r}  r~  current_values           r5   (test_trio_to_thread_run_sync_contextvarsr    s     **,KV$3 !31 55E<F??;&&&

 5Gq4I.I+L+|(,,.M6!!!("""F" 	" ((*f4441 6  /Js"   <B;B7'B;&B9'AB;9B;c                   K   dd} t        |        d {   }t        |t              sJ dddfd}t        j                  t
        d      5  t        |       d {    d d d        y 7 X7 # 1 sw Y   y xY ww)Nc                 8    t        t        j                        } | S rU   )r   r   current_time)	trio_times    r5   thread_fn_1z3test_trio_from_thread_run_sync.<locals>.thread_fn_1  s    (););<	rI   c                    K   y wrU   r^   r^   rI   r5   rq  z0test_trio_from_thread_run_sync.<locals>.async_fn  rc   rd   c                     t                y rU   )r   rs  s   r5   thread_fn_2z3test_trio_from_thread_run_sync.<locals>.thread_fn_2  s    X&rI   zexpected a synchronous functionr   )r=   floatr<   )r   rV  r  re   rf   rr  )r  r  r  rq  s      @r5   test_trio_from_thread_run_syncr    sy      )55Ii'''' 
y(I	J . ---. . 6 	.. .s9   A?A/;A?A3!A1"A3&
A?1A33A<8A?c                   K   g dfddfd} t        |        d {    ddgk(  sJ dd}t        j                  t        d      5  t        t        |       d {    d d d        y 7 N7 # 1 sw Y   y xY ww)	Nc                 X   K   t        j                           j                  d       y w)Nback in trio)r   r  r*   rG   s   r5   back_in_trio_fnz2test_trio_from_thread_run.<locals>.back_in_trio_fn  s     n%s   '*c                 >    j                  d       t                y )N	in thread)r*   r   )r  r4   s   r5   r   z,test_trio_from_thread_run.<locals>.thread_fn  s    k"(rI   r  r  c                      y rU   r^   r^   rI   r5   sync_fnz*test_trio_from_thread_run.<locals>.sync_fn  s    rI   zappears to be synchronousr   r<   )r   re   rf   rr  r   )r   r  r  r4   s     @@r5   test_trio_from_thread_runr    s      F&) Y
'''k>2222 
y(C	D ; ':::; ; ( 	;; ;s9   BA1,BA5#A3$A5(
B3A55A>:Bc                 t   K   dd} t        j                         }t        |        d {   }||k(  sJ y 7 w)Nc                 8    t        t        j                        } | S rU   rd  re  s    r5   r   z.test_trio_from_thread_token.<locals>.thread_fn  rg  rI   rh  ri  rj  s      r5   test_trio_from_thread_tokenr    rm  rn  c                 v   K   dd} t        j                         }t        | |       d {   }||k(  sJ y 7 w)Nc                <    t        t        j                  |       }|S )Nr&   rd  )rZ   rf  s     r5   r   z4test_trio_from_thread_token_kwarg.<locals>.thread_fn  s    +E,D,DQVWrI   )rZ   r   r=   r   ri  rj  s      r5   !test_trio_from_thread_token_kwargr    s>      ++-L+I|DDL<''' Es   (979c                    K   t        j                  t              5  t        t        j
                         d d d        y # 1 sw Y   y xY wwrU   re   rf   rg   r   r   r  r^   rI   r5   test_from_thread_no_tokenr    s6      
|	$ 1U//01 1 1s   A?	AAAc                 (  K   t         j                  d       dd} t        |        d {   \  }}}}}t         j                         }||cxk(  rdk(  sJ  J ||cxk(  r|cxk(  rdk(  sJ  J t	        j
                         dk(  sJ |dk(  sJ y 7 ew)Nr   c                    t         j                         } t         j                  d       t         j                         }t        j                  t
        j                        5  t        j                          d d d        dd}t        |      \  }}t         j                         }t        j                  t
        j                        5  t        j                          d d d        | ||||fS # 1 sw Y   vxY w# 1 sw Y   xY w)Nr|  c                     t         j                         } t         j                  d       t         j                         }t        j                         dk(  sJ | |fS Nback_in_mainr  ru  r   r~   rx  rz  back_parent_valueback_current_values     r5   r  zStest_trio_from_thread_run_sync_contextvars.<locals>.thread_fn.<locals>.back_in_main	  sQ     4 8 8 : $$^4!5!9!9!;002f<<<$&888rI   r=   ztuple[str, str])	ru  r   r~   re   rf   rx  ry  rz  r   )thread_parent_valuethread_current_valuer  r  r  thread_after_values         r5   r   z=test_trio_from_thread_run_sync_contextvars.<locals>.thread_fn  s    2668  *3779]]7<<= 	,))+	,	9 1E\0R--1557]]7<<= 	,))+	,   
 	
	, 	,	, 	,   !C+C7+C47D r|  r  r  r=   ztuple[str, str, str, str, str]ru  r~   r   r   rx  rz  r   r  r  r  r  r  r  s          r5   *test_trio_from_thread_run_sync_contextvarsr    s     V$
@ !++(,,.M/9699999#4V8JVhVVVVV((*f444/// 	,   (BBA&Bc                 (  K   t         j                  d       dd} t        |        d {   \  }}}}}t         j                         }||cxk(  rdk(  sJ  J ||cxk(  r|cxk(  rdk(  sJ  J |dk(  sJ t	        j
                         dk(  sJ y 7 ew)Nr   c                    t         j                         } t         j                  d       t         j                         }t        j                  t
        j                        5  t        j                          d d d        dd}t        |      \  }}t         j                         }t        j                  t
        j                        5  t        j                          d d d        | ||||fS # 1 sw Y   vxY w# 1 sw Y   xY w)Nr|  c                    K   t         j                         } t         j                  d       t         j                         }t        j                         dk(  sJ | |fS wr  r  r  s     r5   async_back_in_mainzTtest_trio_from_thread_run_contextvars.<locals>.thread_fn.<locals>.async_back_in_main4  sU      4 8 8 : $$^4!5!9!9!;002f<<<$&888s   AAr  )	ru  r   r~   re   rf   rx  ry  rz  r   )r  r  r  r  r  r  s         r5   r   z8test_trio_from_thread_run_contextvars.<locals>.thread_fn-  s    2668  *3779]]7<<= 	,))+	,	9 1@@R0S--1557]]7<<= 	,))+	,   
 	
	, 	,	, 	,r  r|  r  r  r  r  r  s          r5   %test_trio_from_thread_run_contextvarsr  *  s     V$
@ !++(,,.M/9699999#4V8JVhVVVVV///((*f444 	,r  c                     t        j                  t              5  t        t        j
                  d       d d d        y # 1 sw Y   y xY w)NzNot TrioTokentyper&   r  r^   rI   r5   3test_run_fn_as_system_task_caught_badly_typed_tokenr  U  s7    	|	$ 
*	

 
 
s	   ?Ac                    K   dd} t        j                         }t        j                  t              5  t        | |       d d d        y # 1 sw Y   y xY ww)Nc                     t               rU   )AssertionErrorr^   rI   r5   
not_calledz7test_from_thread_inside_trio_thread.<locals>.not_called^  s    rI   r&   r<   )r   rY   re   rf   rg   r   )r  r'   s     r5   #test_from_thread_inside_trio_threadr  ]  sI      ))+J	|	$ @ZJ?@ @ @s   2AA	AAAc                     g g dfddfd} t        j                  | d       t        j                  | d       ddgk(  sJ y )	Nc               h  K   	 d  t        j                  d      5  	 t        t        t        t
        d|              d {    j                  d       d d d        y 7 # t         j                  $ r j                  d       Y 1w xY w# 1 sw Y   y xY w# t        j                  d      5  	 t        t        t        t
        d|              d {  7   j                  d       n*# t         j                  $ r j                  d       Y nw xY wd d d        w # 1 sw Y   w xY wxY ww)NTr   r   r&   cleanr   )r   r
   r   r   r   r   r*   RunFinishedError)rZ   r4   s    r5   agenz2test_from_thread_run_during_shutdown.<locals>.agenj  s	    	+""$/ ++,eL   MM'*+ + -- .MM*-.+ +""$/ ++,eL   MM'* -- .MM*-.+ + +s   D2B D2B#A&A$A&
B	D2$A&&$B
BBBBD2D/3D#5#C0C
C0D#0$D	D#D	D#	D/#D,(D//D2c                   K   j                   | rt        j                         nd              d   j                  d        d {    y 7 w)Nr,  )r*   r   rY   asend)use_system_taskr  saves    r5   r   z2test_from_thread_run_during_shutdown.<locals>.mainx  s;     D113DQR2hnnT"""s   AAA	ATFr   r  )rZ   rV   r=   zAsyncGenerator[None, None])r  r   r=   r>   )r   r   )r   r  r4   r  s    @@@r5   $test_from_thread_run_during_shutdownr  f  sH    DF+# 
IIdD	IIdEj'****rI   c                    K   t        j                         } t        | t         j                        sJ t	        j
                  |       }|  |       u sJ y wrU   )r   rY   rV  	TrioTokenweakrefref)rZ   weak_references     r5   "test_trio_token_weak_referenceabler    sG     $$&EeU__---[['NN$$$$s   AAc                    K    G d d      } t        j                  t              5  t        t         |               d {    d d d        y 7 # 1 sw Y   y xY ww)Nc                      e Zd ZddZy)4test_unsafe_abandon_on_cancel_kwarg.<locals>.BadBoolc                    t         rU   )NotImplementedError)r@  s    r5   __bool__z=test_unsafe_abandon_on_cancel_kwarg.<locals>.BadBool.__bool__  s    %%rI   Nr=   r   )r  r  r  r  r^   rI   r5   BadBoolr    s    	&rI   r  r   )re   rf   r  r   rX   )r  s    r5   #test_unsafe_abandon_on_cancel_kwargr    sS     & & 
*	+ C 	BBBC CBC Cs.   $AA AA	AAAAc                    K   t        j                         } dd}| t        t        t         j                         d {   u sJ | t        t        |       d {   u sJ y 7 $7 
w)Nc                 2   K   t        j                         S wrU   )r   current_taskr^   rI   r5   async_current_taskz8test_from_thread_reuses_task.<locals>.async_current_task  s     !!##s   )r=   z
_core.Task)r   r  r   r   r   )taskr  s     r5   test_from_thread_reuses_taskr    s_     D$ +,@%BTBTUUUUU+O=OPPPPP VPs!   ;A&A"A&A$	A&$A&c                 R   K   d dfd} t        |        d {   k7  sJ y 7 	w)Nc                 h    t        j                          t        t        t         j                        S rU   )r+   r   r   r   )tids   r5   get_tid_then_reenterz6test_recursive_to_thread.<locals>.get_tid_then_reenter  s%    !!#193F3FGGrI   )r=   rX   r   )r  r  s    @r5   test_recursive_to_threadr    s/     
CH
 *+?@@@@@@s   '%
'c                 |  K   t        j                         d	fd} t        j                         5 t	        |        d {    d d d        j
                  rJ j                         rJ t        j                         5 t	        | d       d {    d d d        j
                  sJ t	        t        j                  d             d {   rJ d
dd	fd}t        j                         5 t	        |       d {    d d d        j
                  rJ j                         rJ t        j                         5 t	        |d       d {    d d d        j
                  sJ t	        t        j                  d             d {   rJ d	fd}t        j                         5 t	        t        |       d {    d d d        j
                  sJ y 7 # 1 sw Y   xY w7 e# 1 sw Y   exY w7 77 # 1 sw Y   xY w7 # 1 sw Y   xY w7 7 ^# 1 sw Y   ]xY ww)Nc                     t         j                         	 t        t               j                  d       y # t        j
                  $ r j                  d       Y y w xY wNFT)r   r   r   r   r   r   )r   queues   r5   
sync_checkz3test_from_thread_host_cancelled.<locals>.sync_check  sL    \001	 & IIe  	IIdO	s   9 $A A Tr   r   timeoutc                    K   ywNTr^   r^   rI   r5   no_checkpointz6test_from_thread_host_cancelled.<locals>.no_checkpoint  s	     rd   c                     t         j                         	 t              sJ 	 j                  d       y # t        j
                  $ r j                  d       Y y w xY wr  )r   r   r   r   r   r   )r   r  r  s   r5   async_checkz4test_from_thread_host_cancelled.<locals>.async_check  sR    \001	"=111 IIe  	IIdO	s   8 $AAc                    K    j                          t        d      5  t                d {    d d d        y 7 # 1 sw Y   y xY ww)Nr   )r   r   r   )r   s   r5   async_time_bombz8test_from_thread_host_cancelled.<locals>.async_time_bomb  sB     ^ 	"/!!	" 	"!	" 	"s%   A	=;=	A	=AA	r<   r  )
r   r   r   r
   r   r  
get_nowaitr   r   r   )r  r  r  r   r  r  s      @@@r5   test_from_thread_host_cancelledr    s    &2&8&8&:E 
			 - ,,,- ,,,,!!!				 E tDDDE (((('		1(EFFFFF 
			 . ---. ,,,,!!!				 F EEEF (((('		1(EFFFFF"
 
			 C /BBBC ((((W 	-- - 	EE E G 	.. . 	FF F G 	CC Cs   0H<G.G+G.	<H<G>G;G>9H<H&H<;H
HH<H<H HH !9H<H, H<;H0H.H0H<+G..G83H<;G>>H	H<HHH<H  H)%H<.H00H95H<c                F  K   |5  |j                  d       	 t        ||        d {   |j                  d       cd d d        S 7 # t        j                  $ r }|j                  t	        |              d }~ww xY w# |j                  d       w xY w# 1 sw Y   y xY wwr   )r*   r   r   r   r   )r   r  r4   r;   r   s        r5   r   r     s      
 "g	"+AARSS
 MM&!" " T 	MM#a&!	 MM&!" "sY   B!BA	AA	B
B!A		A<A77A<<A??BBBB!cancel_the_scopec                  K   t        j                         dfd}g }t        j                         t	        j
                         }t	        j                         4 d {   }|j                  t        d|||       t                d {    |d   dk(  sJ j                  d      dk(  sJ | r|j                          j                          d d d       d {    | s|d   dk(  sJ y |j                  sJ t        j                  d	|d         s
J |d          |d
   dk(  sJ t!        |      dk(  sJ y 7 7 7 a# 1 d {  7  sw Y   qxY ww)Nc                     	 t                j                  d       j                          t               S # t        j                  $ r$} j                  t	        |              Y d } ~ Ld } ~ ww xY wNNot Cancelled)r   r   r   r   r   r   r   r   r   s    r5   r;   z6test_from_thread_check_cancelled_no_abandon.<locals>.f  sU    	#') EE/"
	*,,  	EE#a&MM	s   
8 A/A**A/Fr   r%   r   r  r  r   zzcancelled due to explicit from task <Task 'trio._tests.test_threads.test_from_thread_check_cancelled_no_abandon' at 0x\w*>r	   rO   r<   )r   r   r+   r   r   r
   r   r   r   r   r   r   r~   r  r   	fullmatchlen)r  r;   r4   r  r  r   r   s        @@r5   +test_from_thread_check_cancelled_no_abandonr    s]    1=1C1C1EA- F		BE!!#  w5%:$&&&ayG###uuQu?222LLN
  ayF"""
 %%%%||f1I
 	 !9		 

 ayF"""6{a/&   s\   AE"D>#E&'EE AEE E!AE EEE
EEEc                   K   t        j                         d
fd} g }t        j                         t	        j
                         }t	        j                         4 d {   }|j                  t        d|||        t                d {    |d   dk(  sJ |j                          d d d       d {    j                          |j                  sJ t        j                  d|d         s
J |d          |d   dk(  sJ j                  d	      }t!        |t"              r|t        j                  d|      sJ |       y 7 7 7 # 1 d {  7  sw Y   xY ww)Nc                    j                          	 t                j                  d       y # t        j                  $ r$} j                  t        |              Y d } ~ y d } ~ wt        $ r} j                  |        Y d } ~ y d } ~ ww xY wr  )r   r   r   r   r   r   r-   r  s    r5   r;   z=test_from_thread_check_cancelled_abandon_on_cancel.<locals>.f%  sd    
			#') EE/"  	EE#a&MM 	 EE!HH	s!   
/ BA!!B-BBTr   r%   zcancelled due to explicit from task <Task 'trio._tests.test_threads.test_from_thread_check_cancelled_abandon_on_cancel' at 0x\w*>r   r,  r   r  r<   )r   r   r+   r   r   r
   r   r   r   r   r   r~   r  r   r  r   rV  r-   )r;   r4   r  r  resr   r   s        @@r5   2test_from_thread_check_cancelled_abandon_on_cancelr     s`    1=1C1C1EA# F		BE!!#  w5$vq9$&&&ayG###	  FFH!!!!<<	iq	  ay	 
 ":
%%%
C#}%	||m
 	 		 
)&   s[   AE$"E	#E$&'EEE,E$7E8BE$EE$E!EE!E$c                 t    t        j                  t              5  t                d d d        t	        j
                          t        j                  t         fd       t        j                  t              5   j                  d      j                          d d d        y # 1 sw Y   }xY w# 1 sw Y   y xY w)Nc                &    j                  |       S rU   )r   )r   r   s    r5   r_   zLtest_from_thread_check_cancelled_raises_in_foreign_threads.<locals>.<lambda>T  s    1558 rI   r   r  )
re   rf   rg   r   r   r   r   r\  r   unwrap)r   s   @r5   :test_from_thread_check_cancelled_raises_in_foreign_threadsr  P  s    	|	$ &#%&-9-?-?-AA	79KL	|	$ "	a!" "	& &" "s   B"8!B."B+.B7c                 "  K   dd} t        d      5  t        j                         4 d {   }t        d      D ]  }|j	                  |         d d d       d {    d d d        y 7 >7 # 1 d {  7  sw Y   xY w# 1 sw Y   y xY ww)Nc                 P   K   	 t        t        t        dd       d {     7 w)Nr   Fr   )r   r   r   r^   rI   r5   r   z+test_reentry_doesnt_deadlock.<locals>.child_  s&     $_eQRWXXX Xs   &$&r	      r<   )r   r   r   r   r   )r   r  r   s      r5   test_reentry_doesnt_deadlockr  Y  s     Y 
q	 *%%' 	* 	*71X *""5)*	* 	** *	* 	* 	* 	* 	** *sa   BBA*B"A.BA,B!	B*B,B.B 	4A75B 	<BBBc                 ,  K   dt               } t               }t               }t               }dd}dfd}t        j                         4 d {   }|j                  || |       |j                  |||       t	                d {    |j                  |       t	                d {    rJ t               dk(  sJ | j                          |j                          d {    t	                d {    rJ t               dk(  sJ |j                          |j                          d {    t	                d {    sJ t               dk(  sJ d d d       d {    y 7 7 7 7 7 ~7 E7 57 # 1 d {  7  sw Y   y xY ww)	NFc                d    K   d fd}t        |       d {    |j                          y 7 w)Nc                 0    t         j                         y rU   )r   r   )r   s   r5   r|   zCtest_wait_all_threads_completed.<locals>.wait_event.<locals>.threadr  s    AFF#rI   r<   )r   r~   )r   e_exitr|   s   `  r5   
wait_eventz3test_wait_all_threads_completed.<locals>.wait_eventq  s*     	$ !(((

 	)s   0.0c                 :   K   t                d {    d y 7 wr  )r   )no_threads_lefts   r5   wait_no_threads_leftz=test_wait_all_threads_completed.<locals>.wait_no_threads_leftx  s     (*** 	+s   r	   r   r   )r   r   r
  r   r=   r>   r<   )r   r   r   r   r   r   r~   r   )e1e2	e1_exited	e2_exitedr  r  r  r  s          @r5   test_wait_all_threads_completedr  i  sq    O	B	BII
 !!# * *w:r95:r95$&&&/0$&&&""""$)))
nn$&&&""""$)))
nn$&&&"$)))'* * * 	'&
 	&
 	&#* * * *s   AFE.F4E?E1	"E?+E3,:E?&E5'E?8E79:E?3E94E?E;E?F(E=)F1E?3E?5E?7E?9E?;E?=F?FFFFc                 R   K   t                d {    t               dk(  sJ y 7 w)Nr   )r   r   r^   rI   r5   *test_wait_all_threads_completed_no_threadsr    s(     
$
&&& A%%% 's   '%'r<   rU   )r   z
int | Noner=   r   )r  zpytest.CaptureFixture[str]r  pytest.MonkeyPatchr=   r>   )r  rX   r   r   r  r   r=   r>   )r  r  r=   r>   )
r   r   r  r
   r4   z	list[str]r;   zCallable[[], None]r=   r>   )r  r   r=   r>   )f
__future__r   contextvarsr  r   r   rm   r+   r   r  	functoolsr   typingr   r   r   re   rx  r   r
   r   r   r   r   r   r   r   _core._tests.test_kir   _core._tests.tutilr   _threadsr   r   r   r   r   r   r   testingr   collections.abcr   r   r   outcomer   lowlevelr    listtupler   r?   r/   r-   rW   r!   r[   rh   r   r   r   r   r   r   r   r  r  markparametrizer6  rK  rX  ra  rl  rt  
ContextVarru  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^   rI   r5   <module>r'     s   "   	 
       	 	 	 + %   -CC%Y--]0CCCDE
CL9Qx-$`/8#:'E\ 1F@0,6"x#,%#,##, 
#,L 
+E4=1.>q+	q+q+ q+ 
	q+ ? 2 ,q+h,(,8(#(	((	(+ 5KK4J4J5 1 
"5J.*;0	(	(1(0V(5V
@+6%CQA8)v""" " 	"
 
"" +eT];(  <( V-`" * *'*T&rI   