
    i_N                        % S r SSKrSSK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	J
r
  SSKJrJr  SSKJrJr  SSKJr  SSKJr  SSKJr  SS	KJrJrJr  SS
KJrJr  SSKJrJrJ r J!r!  SSK"J#r$  SSK%J&r&  SSK'J(r(  SSK)J*r*  SSK+J,r,  SSK-J.r.  \(       a  SSK/J0r0  \ " S5      r1S\2S\34S jr4S\5S\64S jr7S\S\64S jr8S\SS4S jr9SSS.S \S!\3S"\3S\4S# jjr:S$\S\34S% jr;  SCS \	S&\4   S'\<S(   S)\=\5\!S*\4   4   S-  S\>\5   4S+ jjr?S\S'\
\2   S)\=\5\24   S\<\<\2S&4   \=\5\24   4   4S, jr@S\S'\
\2   S)\=\5\24   S\<\<\2S&4   \=\5\24   4   4S- jrAS'\R                  S\S\34S. jrCS/\S\34S0 jrDS/\2S\54S1 jrES2\S\54S3 jrFSS4.S/\S'\
\2   S)\=\5\24   S5\3S\54
S6 jjrGS7\5SS4S8 jrH0 rI\=\5\4   \JS9'   S:\5S\4S; jrKS<R                  5       rM\R                  4S\S=\OS\S-  4S> jjrPS? rQS@ rRS \1S\	\	/\14   4SA jrSS/\	S\34SB jrTg)DzThis file can approximately be considered the collection of hypothesis going
to really unreasonable lengths to produce pretty output.    N)CallableSequence)partialwraps)	Parameter	Signature)StringIO)	iskeyword)_inst)COMMENTgenerate_tokens
untokenize)EllipsisType
ModuleType)TYPE_CHECKINGAnyTypeVarUnion)_patch)HypothesisWarning)lambda_sources)is_typed_named_tuple)not_set)pretty)SearchStrategyTobjreturnc                     [        U S5      $ )z/Determine if the given argument is a mock type.(hypothesis_internal_is_this_a_mock_check)hasattr)r   s    ]/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/hypothesis/internal/reflection.pyis_mockr#   ,   s     3BCC    srcc                     [         R                  " U 5      R                  S   nSR                  U R	                  SS9UR
                  S-
  S 5      n  [        S [        [        U 5      R                  5       5       5      n SR                  S	 U R	                  5        5       5      R                  5       $ ! [         a     Nof = f! [         a     NPf = f)
aE  Return the source code as bytes, without decorators or comments.

Because this is part of our database key, we reduce the cache invalidation
rate by ignoring decorators, comments, trailing whitespace, and empty lines.
We can't just use the (dumped) AST directly because it changes between Python
versions (e.g. ast.Constant)
r    T)keepends   Nc              3   P   #    U  H  oR                   [        :w  d  M  Uv   M     g 7fN)typer   ).0ts     r"   	<genexpr> _clean_source.<locals>.<genexpr>J   s      
>!&&GBSAA>s   &	&
c              3   n   #    U  H+  oR                  5       (       d  M  UR                  5       v   M-     g 7fr+   )rstrip)r-   xs     r"   r/   r0   P   s"     H)9AXXZZQXXZZ)9s   55)astparsebodyjoin
splitlineslineno	Exceptionr   r   r	   readlineencode)r%   funcdefs     r"   _clean_sourcer?   8   s    ))C.%%a(ggcnndn3GNNQ4F4HIJ
 
&x}'='=>
 
 99H)9HHOOQQ    s$   AB6 .C 6
CC
CCfunctionc                 J   [         R                  " 5       n [        R                  " U 5      nUR	                  [        U5      5         UR	                  [        [        U 5      5      R                  5       5         UR	                  U R                  5        UR                  5       $ ! [        [        4 a>     UR	                  U R                  R                  5       5         N! [         a      Nf = ff = f! [         a     Nf = f! [         a     UR                  5       $ f = f)a7  Returns a string that is stable across multiple invocations across
multiple processes and is prone to changing significantly in response to
minor changes to the function.

No guarantee of uniqueness though it usually will be. Digest collisions
lead to unfortunate but not fatal problems during database replay.
)hashlibsha384inspect	getsourceupdater?   OSError	TypeError__name__r=   AttributeErrorreprget_signaturer;   _hypothesis_internal_add_digestdigest)r@   hasherr%   s      r"   function_digestrP   S   s     ^^F*) 	mC() 	d=23::<=h>>? ==?- Y 
	MM(++2245 		  
  ==?sM   B% 1C6 :D %C36)C!!
C/+C3.C//C36
DD
D"!D"sigc           
         U R                   R                  5        Hc  n[        UR                  5      (       d  M  UR                  UR
                  Ld  M:  [        SU < SUR                  < SUR                   S35      e   g )Nz
Signature z contains a parameter named z%, but this is a SyntaxError because `z` is a keyword. You, or a library you use, must have manually created an invalid signature - this will be an error in Python 3.11+)
parametersvaluesr
   namekindPOSITIONAL_ONLY
ValueError)rQ   ps     r"   check_signaturerZ   w   ss    ^^""$QVVq/@/@!@SG#?z J667ffX >LL  %r$   TFfollow_wrappedeval_strtargetr\   r]   c                   [        U SS 5      n[        U[        5      (       aT  [        S U 5       5      (       a=  [	        [        S[
        R                  5      [        S[
        R                  5      /5      $ [        [        U SS 5      [        5      (       Ga'  U R                  n[        U5        UR                  (       a  [        R                  " U 5      (       d  [        R                  " U 5      (       a  [        [        UR                  R!                  5       5      5      nUR"                  S:X  a  UR$                  [
        R&                  L an  UR(                  R"                  R+                  S5      (       aD  UR-                  UR                  R/                  5        VVs/ s H  u  pgUS:w  d  M  UPM     snnS9$ U$ [        R0                  " XUS	9n[        U5        U$ s  snnf )
N	patchingsc              3   B   #    U  H  n[        U[        5      v   M     g 7fr+   )
isinstance	PatchType)r-   rY   s     r"   r/    get_signature.<locals>.<genexpr>   s     (S7aAy)A)A7s   argskeywargs__signature__selfPOSITIONAL_)rS   r[   )getattrrb   listallr   r   VAR_POSITIONALVAR_KEYWORDrg   rZ   rS   rD   isclassismethodnextiterrT   rU   defaultemptyrV   
startswithreplaceitems	signature)r^   r\   r]   patchesrQ   selfykvs           r"   rL   rL      so   
 fk40G'4  S(S7(S%S%S&)":":;*i&;&;<
 	
 '&/48)DD"" >>wv66':J:J6:R:Rcnn33567E

f$MMY__4JJOO..}=={{.1nn.B.B.DT.DdaV.DT #   



FH
UCCJ  Us   !G!
1G!
paramc                     U R                   [        R                  L =(       a-    U R                  [        R                  [        R
                  4;   $ r+   )rs   r   rt   rV   POSITIONAL_OR_KEYWORDKEYWORD_ONLY)r}   s    r"   arg_is_requiredr      s>    ==IOO+ 

''? 1 r$   .re   )SearchStrategy[Any].kwargsr   c                    Uc  0 OUn[         R                  " U 5      (       aU  [        U 5      (       aE  [        U5      [        U R                  S[        U5       5      -  n[        U R                  5      U-
  $  [        U 5      n[        UR                  R                  5       5      [        U5      S  VVs1 s H   u  pV[        U5      (       d  M  XR;  d  M  UiM"     snn$ ! [        [        4 a    [        5       s $ f = fs  snnf )am  Return a set of names of required args to target that were not supplied
in args or kwargs.

This is used in builds() to determine which arguments to attempt to
fill from type hints.  target may be any callable (including classes
and bound methods).  args and kwargs should be as they are passed to
builds() - that is, a tuple of values and a dict of names: values.
N)rD   ro   r   set_fieldslenrL   rX   rH   rk   rS   rw   r   )r^   re   r   providedrQ   rU   r}   s          r"   required_argsr      s     >RvFv#7#?#?v;V^^Kc$i%@!AA6>>"X--F#
   4 4 67D	DDKD5! 	&*&8 	D  	" us$   9C! 6DDD!C>=C>c                     [         R                  " U SS9nUR                  " U0 UD6nUR                  UR                  4$ )zReturns a pair of a tuple and a dictionary which would be equivalent
passed as positional and keyword args to the function. Unless function has
kwonlyargs or **kwargs the dictionary will always be empty.
Fr\   )rD   rx   bindre   r   )r@   re   r   rQ   bounds        r"   convert_keyword_argumentsr      s<     

HU
;CHHd%f%E::u||##r$   c                 (   [         R                  " U SS9nUR                  " U0 UD6n/ n[        UR                  5      nUR
                  R                  5        GH)  nUR                  U;   d  M  UR                  UR                  L a,  UR                  UR                  UR                  5      5        M[  UR                  UR                  L a,  UR                  UR                  UR                  5      5        M  UR                  UR                  L d  M  [        XgR                     5      R!                  [        U5      UR                  1-
  5      (       d   eUR#                  UR                  UR                  5      5        GM,     [%        U5      U4$ )zReturn a tuple (new_args, new_kwargs) where all possible arguments have
been moved to kwargs.

new_args will only be non-empty if function has pos-only args or *args.
Fr   )rD   rx   r   dict	argumentsrS   rT   rU   rV   rW   appendpoprm   extendrn   r   
isdisjointrF   tuple)r@   re   r   rQ   r   new_args
new_kwargsrY   s           r"   convert_positional_argumentsr      s#    

HU
;CHHd%f%EHeoo&J^^""$66Zvv***
qvv 671+++
qvv 671==(:ff-.99#j/QVVH:TUUUU!!*.."89 % ?J&&r$   c                    / nU R                    H.  nUR                  UR                  [        R                  45        M0     U R
                   H.  nUR                  UR                  [        R                  45        M0     U R                  b5  UR                  U R                  R                  [        R                  45        U R                   H.  nUR                  UR                  [        R                  45        M0     U R                  b5  UR                  U R                  R                  [        R                  45        X!R                  R                  5        Vs/ s H  oDR                  UR                   4PM     sn:H  $ s  snf r+   )posonlyargsr   argr   rW   re   r   varargrm   
kwonlyargsr   kwargrn   rS   rT   rU   rV   )re   rQ   expectednoderY   s        r"   ast_arguments_matches_signaturer      s   &(H  9#<#<=> !		9#B#BCD {{)*B*BCD9#9#9:;  zz)>)>?@..2G2G2IJ2IQ(2IJJJJs   !Ffc                 B  ^  [         R                  " [        R                  " [        R
                  " U 5      5      5      n[        [        [        U 5      R                  5      5      m[        U4S j[         R                  " U5       5       5      $ ! [         a     gf = f)z&Is the given name referenced within f?Tc              3      >#    U  H`  n[        U[        R                  5      =(       a:    UR                  T:H  =(       a$    [        UR                  [        R
                  5      v   Mb     g 7fr+   )rb   r5   NameidctxLoad)r-   r   rU   s     r"   r/   8is_first_param_referenced_in_function.<locals>.<genexpr>  sS       #D 	4" 	+GGtO	+txx*	+ #s   A(A+)r5   r6   textwrapdedentrD   rE   r;   rq   rr   rL   rS   anywalk)r   treerU   s     @r"   %is_first_param_referenced_in_functionr      s~    yy):):1)=>? ]1%0012D  HHTN	    s   >B 
BBc                 R   [        U [        5      (       a  [        U 5      $ [        U S5      (       d  [	        U 5      $ U R
                  nUS:X  a  [        R                  " U 5      $ [        U [        R                  [        R                  45      (       a]  U R                  nUbL  [        R                  " U5      (       d1  [        R                  " U5      (       d  U[        L a  SU 3$ U< SU 3$ U$ [        U[         5      (       a!  [#        [$        U['        5       5      U L a  SU 3$ U$ )NrI   <lambda>zrandom..zdict.)rb   r   r   r!   rK   rI   r   lambda_descriptiontypes
MethodTypeBuiltinMethodType__self__rD   ro   ismoduleglobal_random_instancestrrj   r   object)r   rU   rh   s      r"   get_pretty_function_descriptionr     s    !Way1j!!Aw::Dz0033	A((%*A*AB	C	Czz  5 59I9I$9O9O-- ''XQtf%% K 
D#		74vx#@A#Etf~Kr$   r|   c                     [         R                  " U 5      (       a  [        U 5      $ [        U [        5      (       a  U R
                  $ [        R                  " SS[        U 5      5      $ )Nz(\[)~([A-Z][a-z]*\])z
\g<1>\g<2>)	rD   
isfunctionr   rb   r,   rI   resubr   )r|   s    r"   nicereprr   $  sO    !.q11	At		zz vv-}fQiHHr$   )reorderr   c          
      L   U(       a  [        XU5      u  pU Vs/ s H  n[        U5      PM     nn[        U 5      R                  R	                  5        H  nUR
                  U;   d  M  UR                  R
                  R                  S5      (       a  MA  UR                  UR
                   S[        UR                  UR
                  5      5       35        M     U(       a3  [        U5       H$  nUR                  U S[        X'   5       35        M&     [        U 5      nUR                  S5      (       a  SU;   a  SU S3n[        U5      [        S U 5       5      -   n	U	S:  a!  [        R                  " S	U	S
-   S3[        SS9  US-   SR!                  U5      -   S-   $ s  snf )NVAR_=lambda:()c              3   8   #    U  H  n[        U5      v   M     g 7fr+   )r   )r-   bs     r"   r/   repr_call.<locals>.<genexpr>A  s     3dc!ffds   i0u  zSGenerating overly large repr. This is an expensive operation, and with a length of i  z` kB is unlikely to be useful. Use -Wignore to ignore the warning, or -Werror to get a traceback.   )
stacklevel, )r   r   rL   rS   rT   rU   rV   ru   r   r   sortedr   sumwarningswarnr   r8   )
r   re   r   r   r4   bitsrY   areprepr_lens
             r"   	repr_callr   .  so    3AVD!%&AHQKD&1((//166VAFFKK$:$:6$B$BKK166(!HVZZ-?$@#ABC 2 AKK1#Qx	2345   1+C
~~hC3J#aj3x#3d333H%#T>* +DD 	
 9tyy&,,+ 's   F!
identifierc                 L    U R                  5       (       d  [        U < S35      eg )Nz! is not a valid python identifier)isidentifierrX   )r   s    r"   check_valid_identifierr   M  s)    ""$$J>)JKLL %r$   
eval_cachesourcec                 $    [         U    $ ! [         a     Of = f[        R                  " U R	                  5       5      R                  5       n[        SU-   5      n[        U [        5      (       d   e[        XR                  5        U[         U '   U$ )Nhypothesis_temporary_module_)r   KeyErrorrB   rC   r=   	hexdigestr   rb   r   exec__dict__)r   r   results      r"   source_exec_as_moduler   U  s    &!!  v}}/99;I6BCFfc""""!JvMs    
z
from hypothesis.utils.conventions import not_set

def accept({funcname}):
    def {name}{signature}:
        return {funcname}({invocation})
    return {name}
rV   c                 l    U R                   R                  5        H  nUR                  UL d  M  Us  $    g r+   )rS   rT   rV   )rQ   rV   rY   s      r"   get_varargsr   m  s0     ^^""$66T>H % r$   c           	      ^  ^ ^^^^^ T S:X  a  Sm [        T 5        TR                   H  n[        U5        M     1 TR                  kT imTR                  U4S jTR                  R                  5        5        Vs/ s H1  nUR                  TR
                  L a  UOUR                  [        S9PM3     snTR
                  S9mTR                  R                  5        Vs/ s H1  nUR                  R                  R                  S5      (       d  M/  UPM3     snmUU UUUU4S jnU$ s  snf s  snf )zXA decorator which sets the name, signature and docstring of the function
passed into it.r   _lambda_c              3   V   >#    U  H  nUR                  TR                  S 9v   M      g7f))
annotationN)rv   rt   r-   rY   rx   s     r"   r/   ,define_function_signature.<locals>.<genexpr>  s'      6A 		Y__	56s   &))rs   )rS   return_annotationri   c                   > [         R                  " U SS9n/ n/ nT Ha  nUR                  UR                  ;  a)  [	        U5      c  UR                  UR                  5        MF  UR                  UR                  5        Mc     [	        T5      b'  UR                  S[	        T5      R                  -   5        U H  nUR                  U SU 35        M     TR                  R                  5        HH  nUR                  UR                  L d  M  UR                  UR                   SUR                   35        MJ     [	        T[        R                  S9nU(       a  UR                  SUR                  -   5        S/[        S[        T5      S	-   5       Vs/ s H  nS
U 3PM
     sn-   nU H  n	U	T;  d  M    O   [        R                  TW	[        T5      SR!                  U5      S9n
[#        U
5      R%                  U 5      nTUl        [)        U4S jTR                  R                  5        5       5      Ul        TR                  R                  5        Vs0 s HP  nUR,                  TR.                  Ld  M  UR                  UR                  L d  M9  UR                  UR,                  _MR     nnU(       a  Xl        TR                  R                  5        Vs0 s H5  nUR2                  TR.                  Ld  M  UR                  UR2                  _M7     nnTR4                  TR.                  La  TR4                  US'   U(       a  Xl        U$ s  snf s  snf s  snf )NFr   *r   )rV   z**r   r)   r   f_r   )rU   funcnamerx   
invocationc              3      >#    U  HH  nUR                   TR                  Ld  M  S UR                  R                  ;   d  M:  UR                   v   MJ     g7f)
POSITIONALN)rs   rt   rV   rU   r   s     r"   r/   <define_function_signature.<locals>.accept.<locals>.<genexpr>  sC      $
2yy	/ 4@AFFKK4O AII2s   AA Ar   )rD   rx   rU   rS   r   r   rT   rV   r   r   rn   ranger   COPY_SIGNATURE_SCRIPTformatr   r8   r   accept__doc__r   __defaults__rs   rt   __kwdefaults__r   r   __annotations__)r   fsigmust_pass_as_kwargsinvocation_partsrY   r{   varkwicandidate_namesr   r   r   
kwdefaultsannotations	docstringrU   newsigpos_argsrx   
used_namess                 r"   r   )define_function_signature.<locals>.accept  s     59 AvvT__,T1B1J#**1662 ''/	 
 y!-##C+i*@*E*E$EF$A##qc1#J/ %%%,,.Avv' ''166(!AFF8(<= / II,A,AB##D5::$56%U1c*oPQ>Q5R"S5RRs85R"SS'Hz) ( '--&kyy!12	 . 
 'v.55a8"# $
))002$
 
 ))002
2yy	/ 45FFann4L AFFAII2 	 

 $.! ))002
2||9??2 !AFFALL 2 	 

 &&ioo=$-$?$?K!%0"G #T&

s$   MM6MMM8M)
r   rS   rv   rT   rs   rt   r   rV   rU   ru   )	rU   r	  rx   r   rY   r   r
  r  r  s	   ```   @@@r"   define_function_signaturer  v  s    z4 !!q! " /9''..J"--446
 ioo-A199W93MM
 $//  	F %%,,..A66;;!!-0 	
.H7 7r MS
s   98D%.D*D*c                    ^  U 4S jnU$ )zDecorator to update the attributes of a function so that to external
introspectors it will appear to be the target function.

Note that this updates the function in place, it doesn't return a
new one.
c                 (  > U R                   R                  TR                   R                  TR                   R                  S9U l         TR                  U l        TR
                  U l        TR                  U l        SU R                  S'   TU l        U $ )N)co_filenameco_firstlinenoT__hypothesistracebackhide__)	__code__rv   r  r  rI   
__module__r   __globals____wrapped_target)r   r^   s    r"   r   impersonate.<locals>.accept  s}     ZZ''33!??99 ( 

 __
((NN	7;34 $r$    )r^   r   s   ` r"   impersonater    s      Mr$   c           	         ^ ^ [        T R                  R                  SS5      T R                  [	        T SS95      mUU 4S jnU$ )Nr   r   Fr   c                 P   > [        T5      " [        T5      " T" U 5      5      5      $ r+   )r  r   )proxyreplace_sigr^   s    r"   r   proxies.<locals>.accept  s!    6"5=U1C#DEEr$   )r  rI   rv   r   rL   )r^   r   r  s   ` @r"   proxiesr     s?    +
J7fU3KF Mr$   c                     U R                   n[        [        R
                  " U 5      5      nUR                  US-   :w  d  UR                  S:  a  gU(       a  S OS n UR                  UR                   R                  :H  $ ! [         a-     U R                  n U R                   n N! [         a      gf = ff = f! [         a     gf = f)NFr)   r   c                     U$ r+   r  )rh   r4   s     r"   <lambda>&is_identity_function.<locals>.<lambda>	  s    r$   c                     U $ r+   r  )r4   s    r"   r#  r$  	  s    r$   )	r  rJ   __call__intrD   rp   co_argcountco_kwonlyargcountco_code)r   code
bound_argstemplates       r"   is_identity_functionr.    s    zz W%%a()J:>)T-C-Ca-G '1!{H||x008888%  	

A::D 			&  
 s;   B "B< 
B9B''
B51B94B55B9<
C	C	)r  N)Ur   r5   rB   rD   r   r   r   r   collections.abcr   r   	functoolsr   r   r   r   ior	   keywordr
   randomr   r   tokenizer   r   r   r   r   typingr   r   r   r   unittest.mockr   rc   hypothesis.errorsr   hypothesis.internalr   hypothesis.internal.compatr   hypothesis.utils.conventionsr   hypothesis.vendor.prettyr   *hypothesis.strategies._internal.strategiesr   r   r   boolr#   r   bytesr?   rP   rZ   rL   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   lstripr   rm   r'  r   r  r  r   r.  r  r$   r"   <module>r@     sM  <    	    . $ (   2 9 9 * 5 5 - / . ; 0 +ICL	D 	DD 	DRs Ru R6!c !e !H	 	t 	 ,0%!!$(!;?!!H9   /1KOS#X
*
+ e1<?@@ADH 	X	<	$	$!&)	$37V3D	$
5tCK001	$''!&)'37V3D'
5tCK001'0K#-- Ki KD KS T v # ,I I I SW-
-6"-,0f,=-KO-->Ms Mt M
 %'
Dj! &# *  FH  !* 8 8	Up6
A 
(H:q=1 
H  r$   