
    i>                         S SK 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  \(       a  S SKJrJr  \" S5      rSS jrS\\\4   S
\\   4S jrS\\   S
\4S jrSS	S
\4S jrg)    N)Counter)Iterable)TYPE_CHECKINGcast)Phase)DynamicVariable)PhaseStatisticsStatisticsDict
stats_dictr
   returnc                 <    [         R                  nUb	  U" U 5        g g N)	collectorvalue)r   callbacks     T/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/hypothesis/statistics.pynote_statisticsr      s    H     best_targetsc                    U (       d  / $ [        U 5      S:X  a0  [        [        U R                  5       5      5      u  pSUS SU< S3/$ S/n[	        U R                  5       S S9 H  u  pUR                  US	 SU< S35        M      U$ )
zBReturn a list of lines describing the results of `target`, if any.   zHighest target score: gz	  (label=)zHighest target scores:c                     U S S S2   $ )N xs    r   <lambda>"describe_targets.<locals>.<lambda>,   s    q2wr   keyz>16g)lennextiteritemssortedappend)r   labelscoreliness       r   describe_targetsr,      s     		\	a	D!3!3!567(q	UHA>??)*"<#5#5#7=NOLELLE$<z5(!45 Pr   timesc                 F   [        U 5      n[        U5      S-
  nUS:  d  [        S U 5       5      (       a  g[        U[        R
                  " US-  5         S-  5      n[        U[        R                  " US-  5         S-  5      nUS:X  a  gX4:X  a  S	U S
3$ S	U SU S3$ )zvFormat `times` into a string representing approximate milliseconds.

`times` is a collection of durations in seconds.
r   r   c              3   N   #    U  H  n[         R                  " U5      v   M     g 7fr   )mathisnan.0ts     r   	<genexpr>format_ms.<locals>.<genexpr>8   s     37aDJJqMM7s   #%zNaN msg?i  gffffff?z< 1msz~ ms-z ms)r'   r#   anyintr0   floorceil)r-   orderednloweruppers        r   	format_msrA   1   s    
 UmGGqA1u37333

1t8,-45E		!d(+,t34Ez	E7"~E7!E7#&&r   c                    SU ;   a	  U S   S-   /O/ nSnS [        [        5      SS  5        GH  n[        SU R                  US-   0 5      5      nUR                  S	/ 5      nU(       d  M>  [	        S
 U 5       5      n[        S U 5       5      n[        S U 5       5      nUR                  SU SUS   S SU SU SUS    SUS    SUS   US   -    S35        US   U-
  n	U	(       a6  U	S:  n
UR                  SR                  U	S[        U5      -  SU
-  5      5        US   nUS:X  a{  [	        [        S  U 5       / 5      5      nU(       aX  UR                  S!5        U[        UR                  5       S" S#9 VVs/ s H  u  pS$S%U-  [        U5      -  S S&U 3PM     snn-  nUS':X  a-  UR                  S(R                  [        U5      US)   5      5        UR                  S*5        GM     [        U R                  S+0 5      5      nU(       a2  UR                  S,US   -   5        UR                  S- USS  5       5        UR                  S.U S/   -   5        S0R                  U5      $ s  snnf )1a  Return a multi-line string describing the passed run statistics.

`stats_dict` must be a dictionary of data in the format collected by
`hypothesis.internal.conjecture.engine.ConjectureRunner.statistics`.

We DO NOT promise that this format will be stable or supported over
time, but do aim to make it reasonably useful for downstream users.
It's also meant to support benchmarking for research purposes.

This function is responsible for the report which is printed in the
terminal for our pytest --hypothesis-show-statistics option.
nodeidz:
r   c              3   8   #    U  H  oR                   v   M     g 7fr   )name)r3   ps     r   r5   &describe_statistics.<locals>.<genexpr>S   s     2/Q&&/s   r   Nr	   z-phasez
test-casesc              3   *   #    U  H	  oS    v   M     g7f)statusNr   r2   s     r   r5   rG   Y   s     61X;   c              3   *   #    U  H	  oS    v   M     g7f)runtimeNr   r2   s     r   r5   rG   Z   s     ;U|UrJ   c              3   *   #    U  H	  oS    v   M     g7f)drawtimeNr   r2   s     r   r5   rG   [   s     =u!*urJ   z  - during z phase (zduration-secondsz.2fz# seconds):
    - Typical runtimes: z, of which z in data generation
    - validz passing examples, interestingz failing examples, invalidoverrunz invalid exampleszdistinct-failuresz/    - Found {}{} distinct error{} in this phasez moresgeneratec              3   *   #    U  H	  oS    v   M     g7f)eventsNr   r2   s     r   r5   rG   n   s     !=u!H+urJ   z    - Events:c                     U S   * U S   4$ )Nr   r   r   r   s    r   r   %describe_statistics.<locals>.<lambda>s   s    qteQqT]r   r!   z      * d   z%, shrinkz2    - Tried {} shrinks of which {} were successfulzshrinks-successful targetsz  - c              3   ,   #    U  H
  nS U-   v   M     g7f)z    Nr   )r3   ls     r   r5   rG      s     :)9AVaZ)9s   z  - Stopped because zstopped-because
)listr   r   getr   rA   r(   formatboolsumr'   r&   r#   r,   extendjoin)r   r+   prev_failuresphasedcasesstatuses
runtime_msdrawtime_msdistinct_failurespluralrV   kvtarget_liness                  r   describe_statisticsrs   D   s    /7*.DZ!E)*"EM2$u+ab/2"JNN583CR$HIlB'666;U;;
=u==%+=)>s(C D''1l+k] Kg&'':8M;R:S T!!))!4x	7J!J KK\^	
 12]B&*FLLAHH%wm1D'DcFl
 -.JS!=u!=rBCF_- &v||~;R S S sQwU3C8A3? S 
 HLLDKKJ"6 7
 	RS 3V $JNN9b$ABLVl1o-.:ab)9::	LL'*5F*GGH99U%s   <$I+
)r   r
   r   N)r0   collectionsr   collections.abcr   typingr   r   hypothesis._settingsr   !hypothesis.utils.dynamicvariablesr   %hypothesis.internal.conjecture.enginer	   r
   r   r   dictstrfloatr`   r,   rA   rs   r   r   r   <module>r}      sy      $ & & =UD!	4U
#3 S	 $'Xe_ ' '&?$4 ? ?r   