
    ybjF                    2   % S SK Jr  S SKr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  \	R                   R#                  S5      r\	R                   R#                  S5      r\R(                  " S5      r  S6           S7S jjrS8S	 jrS9S
 jr " S S\R2                  5      r " S S5      rS:S;S jjrS:S;S jjrS<S jrS<S jrS=S jr S>S jr!        S?S jr"  S6               S@S jjr# S:         SAS jjr$ S:         SBS jjr%SCS jr&SCS jr'SCS jr(SDSES jjr)SDSES jjr*SDSES jjr+          SFS jr,    SG           SHS  jjr- " S! S"5      r.SIS# jr/SJS$ jr0 SD     SKS% jjr1\	R                   R#                  S5      (       a  \(       a  S&S'K2J3r3  SLS( jr4OSLS) jr4        SMS* jr3SNS+ jr5SJS, jr6      SOS- jr7\7" S. \)5      r8\7" S/ \*5      r9\7" S0 \+5      r:\&\'\(S1.r;S2\<S3'   \)\*\+S1.r=S4\<S5'   g)P    )annotationsN)TracebackTypeWeakKeyDictionarycygwinwinz\033\[[0-?]*[ -/]*[@-~]c           	     D    Uc  [        U 5      nUc  Sn[        U UUSUUS9$ )NreplaceT)line_bufferingforce_readableforce_writable)get_best_encoding_NonClosingTextIOWrapper)streamencodingerrorsr   r   s        ډ/tmp/claude-0/-home-danvics-docker-quiz/c1e0577a-e42c-4a3d-b1ea-3edd61103a4e/scratchpad/stt/lib/python3.13/site-packages/click/_compat.py_make_text_streamr      s=     $V,~#%%     c                j     [         R                  " U 5      R                  S:H  $ ! [         a     gf = f)z$Checks if a given encoding is ascii.asciiF)codecslookupnameLookupError)r   s    r   is_ascii_encodingr   +   s3    }}X&++w66 s   "% 
22c                z    [        U SS5      =(       d    [        R                  " 5       n[        U5      (       a  gU$ )z1Returns the default stream encoding if not found.r   Nzutf-8)getattrsysgetdefaultencodingr   )r   rvs     r   r   r   3   s1    	T	*	Fc.D.D.FBIr   c                  b   ^  \ rS rSr  S             SU 4S jjjrSS jrS	S jrSrU =r$ )
r   ;   c                   > [         R                  " [         R                  [        XU5      5      =U l        n[
        TU ]  " XU40 UD6  g N)tcastBinaryIO_FixupStream_streamsuper__init__)selfr   r   r   r   r   extra	__class__s          r   r,   !_NonClosingTextIOWrapper.__init__<   sB     !"JJV^L!
 	
v 	6;U;r   c                F     U R                  5         g ! [         a     g f = fr%   )detach	Exceptionr-   s    r   __del__ _NonClosingTextIOWrapper.__del__J   s"    	KKM 		s    
  c                6    U R                   R                  5       $ r%   )r*   isattyr4   s    r   r8   _NonClosingTextIOWrapper.isattyP   s    ||""$$r   )r*   FF)r   
t.BinaryIOr   
str | Noner   r<   r   boolr   r=   r.   t.AnyreturnNone)r?   r@   r?   r=   )	__name__
__module____qualname____firstlineno__r,   r5   r8   __static_attributes____classcell__)r/   s   @r   r   r   ;   sh      %$<< < 	<
 < < < 
< <% %r   r   c                  f    \ rS rSrSr  S     SS jjrSS jrSS jrSS jrSS jr	SS jr
S	rg
)r)   U   a9  The new io interface needs more from streams than streams
traditionally implement.  As such, this fix-up code is necessary in
some circumstances.

The forcing of readable and writable flags are there because some tools
put badly patched objects on sys (one such offender are certain version
of jupyter notebook).
c                (    Xl         X l        X0l        g r%   )r*   _force_readable_force_writable)r-   r   r   r   s       r   r,   _FixupStream.__init___   s     --r   c                .    [        U R                  U5      $ r%   )r   r*   r-   r   s     r   __getattr___FixupStream.__getattr__i   s    t||T**r   c                    [        U R                  SS 5      nUb!  [        R                  " [        U" U5      5      $ U R                  R                  U5      $ )Nread1)r   r*   r&   r'   bytesread)r-   sizefs      r   rS   _FixupStream.read1l   sC    DLL'40=66%4))||  &&r   c                    U R                   (       a  g[        U R                  SS 5      nUb   [        R                  " [
        U" 5       5      $  U R                  R                  S5        g! [         a     gf = f)NTreadabler   F)rK   r   r*   r&   r'   r=   rU   r3   r-   xs     r   rZ   _FixupStream.readablet   sh    DLL*d3=66$$$	LLa    		s   A* *
A76A7c                N   U R                   (       a  g[        U R                  SS 5      nUb   [        R                  " [
        U" 5       5      $  U R                  R                  S5        g! [         a0     U R                  R                  S5         g! [         a      gf = ff = f)NTwritabler   F)rL   r   r*   r&   r'   r=   writer3   r[   s     r   r_   _FixupStream.writable   s    DLL*d3=66$$$	LLs#   	""3'   	s*   A* *
B$5B
B B$B  B$c                    [        U R                  SS 5      nUb   [        R                  " [        U" 5       5      $  U R                  R                  U R                  R                  5       5        g! [         a     gf = f)NseekableFT)r   r*   r&   r'   r=   seektellr3   r[   s     r   rc   _FixupStream.seekable   si    DLL*d3=66$$$	LLdll//12   		s   3A0 0
A=<A=)rK   rL   r*   Nr:   )r   r;   r   r=   r   r=   r   strr?   r>   )rV   intr?   rT   rA   )rB   rC   rD   rE   __doc__r,   rP   rS   rZ   r_   rc   rF    r   r   r)   r)   U   sI      %$	.. . 	.+'
r   r)   c                f     [        U R                  S5      [        5      $ ! [         a    Us $ f = fNr   )
isinstancerU   rT   r3   r   defaults     r   _is_binary_readerrq      s0    &++a.%00 s   ! 00c                     U R                  S5        g! [         a)     U R                  S5         g! [         a     Of = fUs $ f = f)Nr    FT)r`   r3   ro   s     r   _is_binary_writerrt      sT    S   	LL 		s%    
A2
?A?AAc                    [        U S5      (       a%  [        R                  " [        R                  U 5      $ [	        U SS 5      nUb6  [        US5      (       a%  [        R                  " [        R                  U5      $ g NFbufferT)rq   r&   r'   r(   r   r   bufs     r   _find_binary_readerrz      `    
 ''vvajj&))
&(D
)C ,S$77vvajj#&&r   c                    [        U S5      (       a%  [        R                  " [        R                  U 5      $ [	        U SS 5      nUb6  [        US5      (       a%  [        R                  " [        R                  U5      $ g rv   )rt   r&   r'   r(   r   rx   s     r   _find_binary_writerr}      r{   r   c                @    [        [        U SS5      =(       d    S5      $ )z3A stream is misconfigured if its encoding is ASCII.r   Nr   )r   r   r   s    r   _stream_is_misconfiguredr      s     WVZ>I'JJr   c                N    [        XS5      nX2:H  =(       d    USL =(       a    USL$ )zA stream attribute is compatible if it is equal to the
desired value or the desired value is unset and the attribute
has a value.
N)r   )r   attrvaluestream_values       r   _is_compat_stream_attrr      s,    
 6.L PUd]%O|47OPr   c                D    [        U SU5      =(       a    [        U SU5      $ )z[Check if a stream's encoding and errors attributes are
compatible with the desired values.
r   r   )r   )r   r   r   s      r   _is_compatible_text_streamr      s)     "
H ;
 6
:;r   c                B   U" U S5      (       a&  [         R                  " [         R                  U 5      nOZ[         R                  " [         R                  U 5      n [	        XU5      (       a  Uc  [        U 5      (       d  U $ U" U 5      nUc  U $ UnUc  Sn[        UUUUUS9$ )NFr
   )r   r   )r&   r'   r(   TextIOr   r   r   )	text_streamr   r   	is_binaryfind_binaryr   r   binary_readerpossible_binary_readers	            r   _force_correct_text_streamr      s     e$$qzz;7ffQXX{3 &kVDD!9+!F!F "-[!9 "). ~ %% r   c           	     .    [        U UU[        [        US9$ )Nr   )r   rq   rz   )text_readerr   r   r   s       r   _force_correct_text_readerr     #     &% r   c           	     .    [        U UU[        [        US9$ )Nr   )r   rt   r}   )text_writerr   r   r   s       r   _force_correct_text_writerr   /  r   r   c                 T    [        [        R                  5      n U c  [        S5      eU $ )Nz6Was not able to determine binary stream for sys.stdin.)rz   r   stdinRuntimeError)readers    r   get_binary_stdinr   ?  s&     +F~STTMr   c                 T    [        [        R                  5      n U c  [        S5      eU $ )Nz7Was not able to determine binary stream for sys.stdout.)r}   r   stdoutr   writers    r   get_binary_stdoutr   F  &     ,F~TUUMr   c                 T    [        [        R                  5      n U c  [        S5      eU $ )Nz7Was not able to determine binary stream for sys.stderr.)r}   r   stderrr   r   s    r   get_binary_stderrr   M  r   r   c                r    [        [        R                  X5      nUb  U$ [        [        R                  XSS9$ )NTr   )_get_windows_console_streamr   r   r   r   r   r!   s      r   get_text_stdinr   T  s0    	$SYY	AB	~	%ciiRVWWr   c                r    [        [        R                  X5      nUb  U$ [        [        R                  XSS9$ NTr   )r   r   r   r   r   s      r   get_text_stdoutr   [  0    	$SZZ	BB	~	%cjj(SWXXr   c                r    [        [        R                  X5      nUb  U$ [        [        R                  XSS9$ r   )r   r   r   r   r   s      r   get_text_stderrr   b  r   r   c                8    SU;   a  [        X5      $ [        XX#S9$ )z?Handles not passing ``encoding`` and ``errors`` in binary mode.br   r   )open)filemoder   r   s       r   _wrap_io_openr   i  s#     d{DX==r   c                2  ^ ST;   n[         R                  " U 5      n [         R                  " U 5      S:X  aV  [        U4S jS 5       5      (       a  U(       a  [	        5       S4$ [        X#S9S4$ U(       a  [        5       S4$ [        X#S9S4$ U(       d  [        U TX#5      S4$ ST;   a  [        S	5      eS
T;   a  [        S5      eST;  a  [        S5      eSS K
nSS Kn [         R                  " U 5      R                  n[         R                  [         R                   -  [         R"                  -  n	U(       a  U	[%        [         SS5      -  n	 [         R&                  R)                  [         R&                  R+                  U 5      SUR-                  S5      S 35      n
 [         R.                  " XUc  SOU5      n Ub  [         R>                  " X5        [        UTX#5      n[A        X[         R&                  RC                  U 5      5      n[D        RF                  " [D        RH                  [D        RJ                     U5      S4$ ! [         a    S n GNRf = f! [         a  nUR                  UR0                  :X  d  [         R2                  S:X  a  UR                  UR4                  :X  ai  [         R&                  R7                  UR8                  5      (       a;  [         R:                  " UR8                  [         R<                  5      (       a   S nAGM  e S nAff = f)Nr   -c              3  ,   >#    U  H	  oT;   v   M     g 7fr%   rk   ).0mr   s     r   	<genexpr>open_stream.<locals>.<genexpr>  s     2/QDy/s   )war\   Fr   Tr   zAppending to an existing file is not supported, because that would involve an expensive `copy`-operation to a temporary file. Open the file in normal `w`-mode and copy explicitly if that's what you're after.r\   z&Use the `overwrite`-parameter instead.r   z,Atomic writes only make sense with `w`-mode.r   O_BINARYz.__atomic-writel        08xi  nt)&osfspathfsdecodeanyr   r   r   r   r   
ValueErrorerrnorandomstatst_modeOSErrorO_RDWRO_CREATO_EXCLr   pathjoindirname	randranger   EEXISTr   EACCESisdirfilenameaccessW_OKchmod_AtomicFilerealpathr&   r'   IOAny)r   r   r   r   atomicbinaryr   r   permflagstmp_filenamefderW   afs    `             r   open_streamr   v  st    D[Fyy"H 
{{8#2/222(*E11"HDeKK#%u,,x?FF XtX>DD d{,
 	
 d{ABB
$GHH 778,44 II

"RYY.EZ++
ww||GGOOH%f..w7<=
	t|eNB 
$b$1A	Qbgg&6&6x&@	AB66!$$quu+r"D((?     	ww%,,&4GGu||+GGMM!**--IIajj"''22	s1    I I II
LB*LLLc                  x    \ rS rSrSS jr\SS j5       rSSS jjrSS jrSS jr	        SS jr
SS jrS	rg
)r   i  c                6    Xl         X l        X0l        SU l        g NF)_f_tmp_filename_real_filenameclosed)r-   rW   r   real_filenames       r   r,   _AtomicFile.__init__  s    )+r   c                    U R                   $ r%   )r   r4   s    r   r   _AtomicFile.name  s    """r   c                    U R                   (       a  g U R                  R                  5         [        R                  " U R
                  U R                  5        SU l         g )NT)r   r   closer   r
   r   r   )r-   deletes     r   r   _AtomicFile.close  s:    ;;


4%%t':':;r   c                .    [        U R                  U5      $ r%   )r   r   rO   s     r   rP   _AtomicFile.__getattr__  s    tww%%r   c                    U $ r%   rk   r4   s    r   	__enter___AtomicFile.__enter__  s    r   c                &    U R                  US LS9  g )N)r   )r   )r-   exc_type	exc_valuetbs       r   __exit___AtomicFile.__exit__  s     	

($.
/r   c                ,    [        U R                  5      $ r%   )reprr   r4   s    r   __repr___AtomicFile.__repr__  s    DGG}r   )r   r   r   r   N)rW   t.IO[t.Any]r   rh   r   rh   r?   r@   r?   rh   F)r   r=   r?   r@   rg   )r?   r   )r   ztype[BaseException] | Noner   zBaseException | Noner   zTracebackType | Noner?   r@   )rB   rC   rD   rE   r,   propertyr   r   rP   r   r  r  rF   rk   r   r   r   r     sZ     # #&0,0 (0 !	0
 
0r   r   c                .    [         R                  SU 5      $ )Nrs   )_ansi_resub)r   s    r   
strip_ansir    s    <<E""r   c                    [        U [        [        45      (       a)  U R                  n [        U [        [        45      (       a  M)  U R                  R
                  R                  S5      $ )Nz
ipykernel.)rn   r)   r   r*   r/   rC   
startswithr   s    r   _is_jupyter_kernel_outputr    sR    
Vl,DE
F
F Vl,DE
F
F &&11,??r   c                    UcM  U c  [         R                  n O[        U S5      (       a  g[        U 5      (       + =(       a    [	        U 5      (       + $ U(       + $ )NcolorF)r   r   hasattrr8   r  )r   r  s     r   should_strip_ansir    sL     }>YYFVW%% &>!K*CF*K&KK9r      )r   c                 *    SS K n U R                  5       $ rm   )localegetpreferredencoding)r  s    r   _get_argv_encodingr    s    **,,r   c                 p    [        [        R                  SS 5      =(       d    [        R                  " 5       $ )Nr   )r   r   r   getfilesystemencodingrk   r   r   r  r    s#    syy*d3Rs7P7P7RRr   c                    g r%   rk   )rW   r   r   s      r   r   r     s     r   c                *    [        [        U 5      5      $ r%   )lenr  )r\   s    r   term_lenr     s    z!}r   c                D     U R                  5       $ ! [         a     gf = fr   )r8   r3   r   s    r   r8   r8     s%    }} s    
c                4   ^ ^^ [        5       mSUU U4S jjnU$ )Nc                    > T" 5       n U c  g  TR                  U 5      nUb  U$ T" 5       n UTU '   U$ ! [         a    S n N"f = f! [         a     U$ f = fr%   )getr3   )r   r!   cachesrc_funcwrapper_funcs     r   func&_make_cached_stream_func.<locals>.func)  s{    >	6"B >I^	E&M 	  	B	  			s    3 A AA
AA)r?   t.TextIO | Noner   )r&  r'  r(  r%  s   `` @r   _make_cached_stream_funcr+  #  s     6G5HE & Kr   c                 "    [         R                  $ r%   )r   r   rk   r   r   <lambda>r-  ?  s    syyr   c                 "    [         R                  $ r%   )r   r   rk   r   r   r-  r-  @      

r   c                 "    [         R                  $ r%   )r   r   rk   r   r   r-  r-  A  r/  r   )r   r   r   z-cabc.Mapping[str, t.Callable[[], t.BinaryIO]]binary_streamszAcabc.Mapping[str, t.Callable[[str | None, str | None], t.TextIO]]text_streamsr:   )r   r;   r   r<   r   r<   r   r=   r   r=   r?   t.TextIO)r   rh   r?   r=   )r   r  r?   rh   r	  )r   r  rp   r=   r?   r=   )r   r  r?   zt.BinaryIO | None)r   r3  r?   r=   )r   r3  r   rh   r   r<   r?   r=   )r   r3  r   r<   r   r<   r?   r=   )r   r  r   r<   r   r<   r   z%t.Callable[[t.IO[t.Any], bool], bool]r   z,t.Callable[[t.IO[t.Any]], t.BinaryIO | None]r   r=   r   r=   r?   r3  )
r   r  r   r<   r   r<   r   r=   r?   r3  )
r   r  r   r<   r   r<   r   r=   r?   r3  )r?   r;   )NN)r   r<   r   r<   r?   r3  )
r   zstr | os.PathLike[str] | intr   rh   r   r<   r   r<   r?   r  )rNstrictF)r   zstr | os.PathLike[str]r   rh   r   r<   r   r<   r   r=   r?   ztuple[t.IO[t.Any], bool])r   rh   r?   rh   )r   r  r?   r=   )r   zt.IO[t.Any] | Noner  zbool | Noner?   r=   r  )rW   r3  r   r<   r   r<   r?   r*  )r\   rh   r?   ri   )r&  t.Callable[[], t.TextIO | None]r'  zt.Callable[[], t.TextIO]r?   r6  )>
__future__r   r   collections.abcabccabcior   rer   typingr&   typesr   weakrefr   platformr  CYGWINWINcompiler  r   r   r   TextIOWrapperr   r)   rq   rt   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  _winconsoler   r  r   r8   r+  _default_text_stdin_default_text_stdout_default_text_stderrr1  __annotations__r2  rk   r   r   <module>rJ     s   "   	 	 	 
   %		 	 	*	lle$
 ::01 !   	
  *%r// %4B BJ
$$KQ;; *;4>;	;" ! +++ + 5	+
 >+ + + +d !	  	
 ( !	  	
  XYY
>
&
>

> 
> 	
>
 
> !N)$N)
N) N) 	N)
 N) N)b! !H#@ =A.9	 <<5!!c8-S)3=	-* %8 //@.Q /0BOT /0BOT  A=  SO r   