
    vKg8                       S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKJ	r	  S SK
Jr  S SKJrJrJrJrJrJrJrJrJr  S SKJr  S SKr\" S\S\4   S	9r\" S
5      r\" S5      r\(       a$  S SKJrJ r   S SK!J"r"J#r#J$r$J%r%  \"" S5      r&\$" S5      r'\(       a  S'S jr(OV\RR                  S:X  aA  S SK*r*\*RV                  " 5       r,\,R[                  S5        \,R]                  S5      r/\0" \/S5      r(OS'S jr(S(S jr1      S)S jr2 " S S5      r3        S*S jr4      S+S jr5 " S S\\   5      r6S,S jr7S-S jr8\(       a  S S KJr  O\8r\ " S! S"\	5      5       r9S.S# jr:\(       a  \" S$\S\;4   S	9r<  S/       S0S% jjr=gS S&K
J=r=  g)1    )annotationsN)ABCMeta)update_wrapper)	TYPE_CHECKINGAny	AwaitableCallableGenericNoReturnSequenceTypeVarfinal)thread_localCallT.)boundTRetT)AsyncGeneratorTypeTracebackType)	ParamSpecSelfTypeVarTupleUnpackArgsTPosArgsTc                    g N signums    J/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/trio/_util.pysignal_raiser"   *   s    3    ntzint raise(int);z!api-ms-win-crt-runtime-l1-1-0.dllraisec                X    [         R                  " [        R                  " 5       U 5        g r   )signalpthread_kill	threading	get_identr   s    r!   r"   r"   Z   s    I//16:r#   c                      [         R                   " [         R                  [         R                  " [         R                  5      5        g! [        [        4 a     gf = f)z7Attempt to reliably check if we are in the main thread.TF)r'   SIGINT	getsignal	TypeError
ValueErrorr   r#   r!   is_main_threadr0   f   sB    fmmV%5%5fmm%DEz" s   AA
 
AAc                   SS jn[         R                  Ssn[         l         U " U6 n U[         l        [        U[        R
                  R                  5      (       dl  U" U5      (       a  [        SU< S
35      e[        R                  " U5      (       a  [        SU< 35      e[        SR                  [        U SU 5      5      5      eU$ ! [         a    [        U [        R
                  R                  5      (       aU  U R                  5         [        SU < SU R                   SU R                   SU R                   SU R                   S35      S eU" U 5      (       a  [        S	U < S
35      S ee f = f! U[         l        f = f)Nc                    [        U [        R                  R                  5      (       a  g[	        U SS 5      b  gU R
                  R                  S;   $ )NT_asyncio_future_blocking)FutureDeferred)
isinstancecollectionsabc	Generatorgetattr	__class____name__)values    r!   &_return_value_looks_like_wrong_libraryBcoroutine_or_error.<locals>._return_value_looks_like_wrong_libraryw   sI     e[__667754d;G ''+AAAr#   triozLTrio was expecting an async function, but instead it got a coroutine object z/

Probably you did something like:

  trio.run(z4(...))            # incorrect!
  nursery.start_soon(zO(...))  # incorrect!

Instead, you want (notice the parentheses!):

  trio.run(z2, ...)            # correct!
  nursery.start_soon(z, ...)  # correct!z9Trio was expecting an async function, but instead it got u    – are you trying to use a library written for asyncio/twisted/tornado or similar? That won't work without some sort of compatibility shim.zTrio got unexpected zAstart_soon expected an async function but got an async generator zCTrio expected an async function, but {!r} appears to be synchronous__qualname__)r=   objectreturnbool)sniffio_loopnamer.   r6   r7   r8   	Coroutinecloser<   inspect
isasyncgenformatr:   )async_fnargsr>   	prev_loopcoros        r!   coroutine_or_errorrP   s   s   B $0#4#4f I| $&F & dKOO55661$77&th /K K  d##!H&   &>8!LM
 	

 K}  h 9 9::NN&&.\ 2 '//0 1((0(9(9': ; '//0 1((0(9(9'::LN   2(;;K, ;;
  	=B &s   C B(E33E6 6Fc                  F    \ rS rSrSrSS jrS	S jr        S
S jrSrg)ConflictDetector   a  Detect when two tasks are about to perform operations that would
conflict.

Use as a synchronous context manager; if two tasks enter it at the same
time then the second one raises an error. You can use it when there are
two pieces of code that *would* collide and need a lock if they ever were
called at the same time, but that should never happen.

We use this in particular for things like, making sure that two different
tasks don't call sendall simultaneously on the same stream.

c                    Xl         SU l        g NF)_msg_held)selfmsgs     r!   __init__ConflictDetector.__init__   s    	
r#   c                t    U R                   (       a   [        R                  " U R                  5      eSU l         g )NT)rW   r@   BusyResourceErrorrV   )rX   s    r!   	__enter__ConflictDetector.__enter__   s%    ::((33DJr#   c                    SU l         g rU   )rW   )rX   exc_type	exc_value	tracebacks       r!   __exit__ConflictDetector.__exit__   s     
r#   )rW   rV   N)rY   strrC   None)rC   rg   )ra   ztype[BaseException] | Nonerb   zBaseException | Nonerc   zTracebackType | NonerC   rg   )	r<   
__module__rA   __firstlineno____doc__rZ   r^   rd   __static_attributes__r   r#   r!   rR   rR      s<    , ( (	
 
r#   rR   c                    ^ ^^ SUU U4S jjnU$ )z@Similar to wraps, but for async wrappers of non-async functions.c                   > TU l         TR                   ST 3U l        STR                   STR                   ST S3U l        U $ )N.zLike :meth:`~z`, but async.)r<   rA   rh   rj   )func	attr_nameclswrapped_clss    r!   	decoratorasync_wraps.<locals>.decorator   sW    !"//0)=&{'='=&>a@X@X?YYZ[dZeersr#   )ro   r   rC   r   r   )rq   rr   rp   rs   s   ``` r!   async_wrapsru      s      r#   c                   ^ ^^^ [        5       mSUU UU4S jjmUR                  5        H(  u  mnTR                  S5      (       a  M  T" TTU5        M*     g )Nc                  > [        U5      T	;   a  g T	R                  [        U5      5        [        USS 5      nUb  UR                  S5      (       a  TUl        [        US5      (       a-  SUR                  ;  a  Xl        [        US5      (       a  Xl        [        U[        5      (       a3  UR                  R                  5        H  u  pET" TS-   U-   XE5        M     g g g g )Nrh   ztrio.r<   rn   rA   )idaddr:   
startswithrh   hasattrr<   rA   r6   type__dict__items)
qualnamerF   objmodrp   
attr_valuefix_onemodule_nameobjnameseen_idss
         r!   r   &fixup_module_metadata.<locals>.fix_one  s     c7hRWc<.?s~~g66(CN sJ''Cs||,C#3//'/$#t$$-0\\-?-?-A)IGcMI5yM .B %  7?r#   _)r   rf   rF   rf   r   rB   rC   rg   )setr~   rz   )r   	namespacer   r   r   r   s   `  @@@r!   fixup_module_metadatar      sL     HN N* ")!!#&&GWc* *r#   c                  6    \ rS rSrSrSS jrS	S jrS
S jrSrg)generic_functioni"  a  Decorator that makes a function indexable, to communicate
non-inferrable generic type parameters to a static type checker.

If you write::

    @generic_function
    def open_memory_channel(max_buffer_size: int) -> Tuple[
        SendChannel[T], ReceiveChannel[T]
    ]: ...

it is valid at runtime to say ``open_memory_channel[bytes](5)``.
This behaves identically to ``open_memory_channel(5)`` at runtime,
and currently won't type-check without a mypy plugin or clever stubs,
but at least it becomes possible to write those.
c                &    [        X5        Xl        g r   )r   _fn)rX   fns     r!   rZ   generic_function.__init__3  s    t r#   c                &    U R                   " U0 UD6$ r   r   )rX   rM   kwargss      r!   __call__generic_function.__call__7  s    xx(((r#   c                    U $ r   r   )rX   	subscripts     r!   __getitem__generic_function.__getitem__:  s    r#   r   N)r   zCallable[..., RetT]rC   rg   )rM   r   r   r   rC   r   )r   rB   rC   r   )	r<   rh   rA   ri   rj   rZ   r   r   rk   r   r#   r!   r   r   "  s     )r#   r   c                L    [        U R                   SU R                   S35      e)z5Raises an exception when a final class is subclassed.rn   z does not support subclassingr.   rh   rA   )rq   s    r!   _init_final_clsr   >  s'    
s~~&a(8(8'99VW
XXr#   c                @    [        [        5      U l        [        U 5      $ )a  Decorator that enforces a class to be final (i.e., subclass not allowed).

If a class uses this metaclass like this::

    @final
    class SomeClass:
        pass

The metaclass will ensure that no subclass can be created.

Raises
------
- TypeError if a subclass is created
)classmethodr   __init_subclass__	std_final)	decorateds    r!   _final_implr   C  s    " #.o">IYr#   )r   c                  :   ^  \ rS rSrSrSS jrSU 4S jjrSrU =r$ )NoPublicConstructori_  a  Metaclass that ensures a private constructor.

If a class uses this metaclass like this::

    @final
    class SomeClass(metaclass=NoPublicConstructor):
        pass

The metaclass will ensure that no instance can be initialized. This should always be
used with @final.

If you try to instantiate your class (SomeClass()), a TypeError will be thrown. Use
_create() instead in the class's implementation.

Raises
------
- TypeError if an instance is created.
c                L    [        U R                   SU R                   S35      e)Nrn   z has no public constructorr   )rq   rM   r   s      r!   r   NoPublicConstructor.__call__t  s,    ~~a 0 011KL
 	
r#   c                $   > [         TU ]  " U0 UD6$ r   )superr   )rq   rM   r   r;   s      r!   _createNoPublicConstructor._createy  s    w000r#   r   )rM   rB   r   rB   rC   rg   )rq   type[T]rM   rB   r   rB   rC   r   )	r<   rh   rA   ri   rj   r   r   rk   __classcell__)r;   s   @r!   r   r   _  s    &

1 1r#   r   c                B   [        U S5      (       d  [        U 5      $  U R                  R                  S   n U R                  nU SU 3$ ! [        [
        4 a    SU R                  R                   S3n N@f = f! [         a    U R                  R                  n NYf = f)zsReturn the fully-qualified name of the async generator function
that produced the async generator iterator *agen*.
ag_coder<   <>rn   )
r{   reprag_frame	f_globalsAttributeErrorKeyErrorr   co_filenamerA   co_name)agenmoduler   s      r!   name_asyncgenr   }  s     4##Dz1((4($$ XQxj!! H% 1T\\--.a01  (<<''(s"   A A; *A87A8; BBFnc                    g r   r   )wrappedassignedupdateds      r!   wrapsr     s     !r#   )r   )r    intrC   rg   )rC   rD   )rL   z-Callable[[Unpack[PosArgsT]], Awaitable[RetT]]rM   zUnpack[PosArgsT]rC   z1collections.abc.Coroutine[object, NoReturn, RetT])rq   type[object]rr   r   rp   rf   rC   zCallable[[CallT], CallT])r   rf   r   z$collections.abc.Mapping[str, object]rC   rg   )rq   r   rC   r   )r   r   rC   r   )r   z$AsyncGeneratorType[object, NoReturn]rC   rf   )..)r   zCallable[..., object]r   Sequence[str]r   r   rC   zCallable[[Fn], Fn])>
__future__r   collections.abcr7   rI   osr'   r)   r8   r   	functoolsr   typingr   r   r   r	   r
   r   r   r   r   r   sniffior   rE   r@   r   r   r   typesr   r   typing_extensionsr   r   r   r   r   r   r"   rF   cffiFFI_fficdefdlopen_libr:   r0   rP   rR   ru   r   r   r   r   r   r   rB   r   r   r   r#   r!   <module>r      s   "   	    $
 
 
 1 xS12CLv7GGgEJ'H . WW_H 88:DII ;;:;D4)L;V;VV 7Vr B	  	$++3+ 
+Fwt} 8Y
 , E 1' 1 1:"$ 	Xc6k2	3B #&!$!&!! ! 
	!  r#   