
    i"              	          % 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	  S SK
Jr  S SKJr  S SKJr  S SKJrJr  S S	KJr  S S
KJr  \	" S5      r\\\4   r\\S'   \\\\S4   \\\\4      4   r\\S'   \" 5       r \\\4   \S'   \\\4   " S5      r!S\S\4S jr"S"S jr#S\S\4S jr$SSS.S\%S\%\S   -  S\\/\4   4S jjr&S\S\%S\'\(   S\4S  jr)S\S\%S\4S! jr*g)#    N)Callable)partial)Literal	TypeAliasTypeVar)WeakValueDictionaryInvalidArgument)LRUReusedCache)clampfloat_to_int)proxies)prettyTValueKey.StrategyCacheKey_all_strategiesi   valuereturnc                 h    [        U [        5      (       a  [        [        U 5      4$ [        U 5      U 4$ N)
isinstancefloatr   type)r   s    d/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/hypothesis/strategies/_internal/utils.py
_value_keyr   $   s.    %|E*++K    c                  ,    [         R                  5         g r   )_STRATEGY_CACHEclear r   r   clear_strategy_cacher"   *   s    r   fnc                 f   ^ ^^ SSK Jm  SSKJm  [	        T 5      UUU 4S j5       n[
        Ul        U$ )Nr   )_current_build_context)SearchStrategyc                    > T	R                   nUb-  UR                  R                  R                  (       a  T
" U 0 UD6$  UR	                  5        VVs1 s H  u  p4U[        U5      4iM     nnnT
[        S U  5       5      [        U5      4n [        U   $ s  snnf ! [         a    T
" U 0 UD6s $ f = f! [         a     O[         a    T
" U 0 UD6s $ f = fT
" U 0 UD6n[        UT5      (       a  UR                  (       a	  U[        U'   U$ )Nc              3   8   #    U  H  n[        U5      v   M     g 7fr   )r   ).0vs     r   	<genexpr>5cacheable.<locals>.cached_strategy.<locals>.<genexpr>?   s     .A*Q--s   )r   dataprovideravoid_realizationitemsr   	TypeErrortuple	frozensetr   KeyErrorr   is_cacheable)argskwargscontextkr*   kwargs_cache_key	cache_keyresultr&   r%   r#   s           r   cached_strategy"cacheable.<locals>.cached_strategy2   s   (..7<<#8#8#J#Jt&v&&	'?E||~N~tqJqM 2~N
 ...&'
	
	'"9--  O 	't&v&&	'  	 	't&v&&	' T$V$&.11V5H5H)/OI&s;   B B+B B4 B B10B14
C CC)hypothesis.controlr%   *hypothesis.strategies._internal.strategiesr&   r   r"   __clear_cache)r#   r=   r&   r%   s   ` @@r   	cacheablerB   .   s/    9IR[ : %9O!r   F)force_reusable_valueseagerrC   rD   tryc                 N   ^ ^ TSLa  T (       a  [        ST S35      eUU 4S jnU$ )a  
Each standard strategy function provided to users by Hypothesis should be
decorated with @defines_strategy. This registers the strategy with _all_strategies,
which is used in our own test suite to check that e.g. we document all strategies
in sphinx.

If you're reading this and are the author of a third-party strategy library:
don't worry, third-party strategies don't need to be decorated with
@defines_strategy. This function is internal to Hypothesis and not intended
for outside use.

Parameters
----------
force_reusable_values : bool
    If ``True``, strategies returned from the strategy function will have
    ``.has_reusable_values == True`` set, even if it uses maps/filters or
    non-reusable strategies internally. This tells our numpy/pandas strategies
    that they can implicitly use such strategies as background values.
eager : bool | "try"
    If ``True``, strategies returned by the strategy function are returned
    as-is, and not wrapped in LazyStrategy.

    If "try", we first attempt to call the strategy function and return the
    resulting strategy. If this throws an exception, we treat it the same as
    ``eager = False``, by returning the strategy function wrapped in a
    LazyStrategy.
FzPassing both eager=z: and force_reusable_values=True is currently not supportedc                 x   >^  T [         T R                  '   TSL a  T $ [        T 5      UUU 4S j5       nSUl        U$ )NTc                     > SSK Jn  TS:X  a	   T" U 0 UD6$ U" TX5      nT(       a  SUl        UR                  (       d   eU$ ! [         a     N8f = f)Nr   )LazyStrategyrE   T)$hypothesis.strategies._internal.lazyrI   	Exceptionforce_has_reusable_valueshas_reusable_values)r6   r7   rI   r<   rD   rC   strategy_definitions       r   accept3defines_strategy.<locals>.decorator.<locals>.accept   sh    I~.???
 ""5tDF$ 4801111M !  s   A 
AA)r   __name__r   is_hypothesis_strategy_function)rN   rO   rD   rC   s   ` r   	decorator#defines_strategy.<locals>.decorator}   sH    8K+445D=&&	$	%	 
&	* 26.r   r	   )rC   rD   rS   s   `` r   defines_strategyrU   T   s>    B E3 !% )& &
 	

> r   objr/   seenc          
      h   [        U [        [        [        [        [        S 5      45      (       a  [        U [        5      (       au  [        U [        5      (       d`  [        U 5      S:  aQ  U(       a  g[        [        R                  R                  * U [        R                  R                  5      n [        U 5      $ U $ U(       a  g[        U 5      nX2;   a
  [        U SS9$ [        [        XU1-  S9n[        U [        [         ["        [$        45      (       aT  [        U [         5      (       a'  ['        U S5      (       a  U" U R)                  5       5      $ U  Vs/ s H
  oT" U5      PM     sn$ [        U [*        5      (       aL  U R-                  5        VVs0 s H.  u  pg[        U[        5      (       a  UO
[        U5      U" U5      _M0     snn$  U" U R/                  5       5      $ s  snf s  snnf ! [0         a     Of = f[2        R4                  " U 5      (       ae  [        U [
        5      (       dP  [2        R6                  " U 5       Vs0 s H)  nUR8                  U" [;        XR8                  5      5      _M+     sn$ s  snf [        R<                  R?                  S5      =n	b5  U	RA                  [        U 5      5      (       a  U" U	RC                  U SS	95      $ [        R<                  R?                  S
5      =n
(       a0  [        X
RD                  5      (       a  U" U RG                  5       5      $ [        U 5      $ )Nl            z
<symbolic>T)cycler/   rW   _asdictattrF)recursepydantic)$r   strintr   boolr   absr   sys
float_infomaxidr   r   _to_jsonablelistr2   setr3   hasattrr[   dictr0   to_jsonrK   dataclassesis_dataclassfieldsnamegetattrmodulesgethasasdict	BaseModel
model_dump)rV   r/   rW   obj_idrecurxr9   r*   fieldr\   pyds              r   rg   rg      s   #S%tDz:;;
 c3
3(=(=#c(eBS !#+++S#..2D2DEC:
WF~c&&(9xE #eS)455c5!!gc9&=&=''"%&#Qa#&&#tIL
ITAs##AE!H<
 	
S[[]## '
   $$ZT-B-B
 %++C0
0 JJgc::6770
 	
 
 ''4$s)9L9LT[[e[455{{z***
30N0NS^^%&& #;s$   G!5G&G, ,
G98G90I7c                &    [        X[        5       S9$ )zRecursively convert an object to json-encodable form.

This is not intended to round-trip, but rather provide an analysis-ready
format for observability.  To avoid side affects, we pretty-print all but
known types.
rZ   )rg   ri   )rV   r/   s     r   to_jsonabler~      s     suMMr   )r   N)+rm   rc   collections.abcr   	functoolsr   typingr   r   r   weakrefr   hypothesis.errorsr
   hypothesis.internal.cacher   hypothesis.internal.floatsr   r   hypothesis.internal.reflectionr   hypothesis.vendor.prettyr   r   r2   r   objectr   __annotations__r3   r_   r   r   r   r   r"   rB   ra   rU   ri   r`   rg   r~   r!   r   r   <module>r      s[    
 $  . . ' - 4 : 2 +CLD&L)) )#
E(C- )E#x-,@"AA )  7J6K$S(]3 K !16!9:4@ f    #! # #P #(#(HH '%. H qc1f	HV7f 7D 7C 7V 7tNV N4 NF Nr   