
    i>                     h   % S SK r S SKrS SKJr  S SKJrJr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JrJrJrJrJr  S S	KJrJrJrJrJ 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.J/r/J0r0J1r1J2r2J3r3  S SK4J5r5J6r6  S SK7J8r8J9r9J:r:  S SK;J<r<  S SK=J>r>  S SK?J@r@JArAJBrBJCrC  S SKDJErE  S SKFJGrG  S SKHJIrI  S SKJJKrK  S SKLJMrM  S SKNJOrO  \(       a  S SKPJQrQ  S SKRJSrS  S SKTJUrU  S SKVJWrW  S\XS\4S jrY\" S5      rZ\[\X\\\]-  4   r^\_\\\,\(\*S-  4   r`\\aS '   \<" S!5      rbS"rc\O" \\S#9rd " S$ S%\5      re\
" S&S&S'9 " S( S)5      5       rf0 rg\[\\\f4   \aS*'   S+\\S\f4S, jrh\"" S-5      ri\"\_\S.4   \(4   \aS/'    " S0 S15      rj " S2 S35      rk " S4 S5\5      rl " S6 S75      rm " S8 S9\k5      rn " S: S;\k5      ro " S< S=\k5      rp " S> S?\k5      rq " S@ SA\k5      rr " SB SC\k5      rs " SD SE5      rt " SF SG5      ru\u" 5       rv " SH SI5      rw\
" S&S&S'9 " SJ SK5      5       rx " SL SM5      rySN\,SO\(SP\S\*4SQ jrzg)R    N)defaultdict)HashableIterableIteratorSequence)	dataclassfield)IntEnum)cached_property)Random)TYPE_CHECKINGAnyLiteralNoReturn	TypeAliasTypeVarcastoverload)CannotProceedScopeTChoiceTooLargeFrozenInvalidArgumentStopTest)LRUCache)add_note)BooleanConstraintsBytesConstraintsChoiceConstraintsT
ChoiceNodeChoiceTChoiceTemplateChoiceTypeTFloatConstraintsIntegerConstraintsStringConstraintschoice_constraints_keychoice_from_indexchoice_permittedchoices_size)IntListgc_cumulative_time)COLLECTION_DEFAULT_MAX_SIZEHypothesisProviderPrimitiveProvider)calc_label_from_name)InterestingOrigin)SMALLEST_SUBNORMALfloat_to_intint_to_floatsign_aware_lte)IntervalSet)PredicateCounts)debug_report)not_set)note_deprecation)ThreadLocal)SearchStrategy)
DataObject)RandomState)Exnamereturnc                 R    U S:X  a  SSK Jn  [        SSSSS9  U$ [        S	U  35      e)
NAVAILABLE_PROVIDERSr   )rB   zhypothesis.internal.conjecture.data.AVAILABLE_PROVIDERS has been moved to hypothesis.internal.conjecture.providers.AVAILABLE_PROVIDERS.z
2025-01-25F   )sincehas_codemod
stacklevelz>Module 'hypothesis.internal.conjecture.data' has no attribute )(hypothesis.internal.conjecture.providersrB   r9   AttributeError)r?   rB   s     b/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/hypothesis/internal/conjecture/data.py__getattr__rJ   S   sD    $$PL	
 #"

HO     TMisalignedAttopd   )global_test_counterc                   2    \ rS rSrSrSrSrSrS\4S jr	Sr
g	)
Statusp   r   rC         r@   c                      SU R                    3$ )NzStatus.)r?   selfs    rI   __repr__Status.__repr__v   s    $$rK    N)__name__
__module____qualname____firstlineno__OVERRUNINVALIDVALIDINTERESTINGstrrY   __static_attributes__r[   rK   rI   rR   rR   p   s"    GGEK%# %rK   rR   T)slotsfrozenc                        \ rS rSr% \\S'   Srg)StructuralCoverageTagz   labelr[   N)r\   r]   r^   r_   int__annotations__re   r[   rK   rI   ri   ri   z   s    JrK   ri   STRUCTURAL_COVERAGE_CACHErk   c                 t     [         U    $ ! [         a"    [         R                  U [        U 5      5      s $ f = fN)rn   KeyError
setdefaultri   rk   s    rI   structural_coveragert      s>    Y(// Y(33E;PQV;WXXYs    )77i   .POOLED_CONSTRAINTS_CACHEc                   &   \ rS rSrSrSrSSS\SS4S	 jrS
\S\	4S jr
S
\S\	4S jrS\4S jr\S\4S j5       r\S\S-  4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\	4S j5       r\S\4S j5       r\SS j5       rSrg)Span   a!  A span tracks the hierarchical structure of choices within a single test run.

Spans are created to mark regions of the choice sequence that are
logically related to each other. For instance, Hypothesis tracks:
- A single top-level span for the entire choice sequence
- A span for the choices made by each strategy
- Some strategies define additional spans within their choices. For instance,
  st.lists() tracks the "should add another element" choice and the "add
  another element" choices as separate spans.

Spans provide useful information to the shrinker, mutator, targeted PBT,
and other subsystems of Hypothesis.

Rather than store each ``Span`` as a rich object, it is actually
just an index into the ``Spans`` class defined below. This has two
purposes: Firstly, for most properties of spans we will never need
to allocate storage at all, because most properties are not used on
most spans. Secondly, by storing the spans as compact lists
of integers, we save a considerable amount of space compared to
Python's normal object size.

This does have the downside that it increases the amount of allocation
we do, and slows things down as a result, in some usage patterns because
we repeatedly allocate the same Span or int objects, but it will
often dramatically reduce our memory usage, so is worth it.
)indexownerrz   Spansry   r@   Nc                     Xl         X l        g rp   )rz   ry   )rX   rz   ry   s      rI   __init__Span.__init__   s    

rK   otherc                     XL a  g[        U[        5      (       d  [        $ U R                  UR                  L =(       a    U R                  UR                  :H  $ )NT
isinstancerw   NotImplementedrz   ry   rX   r   s     rI   __eq__Span.__eq__   sB    =%&&!!

ekk)J

ekk0IJrK   c                     XL a  g[        U[        5      (       d  [        $ U R                  UR                  L=(       d    U R                  UR                  :g  $ )NFr   r   s     rI   __ne__Span.__ne__   sB    =%&&!!

%++-M4::3LMrK   c                 "    SU R                    S3$ )Nzspans[])ry   rW   s    rI   rY   Span.__repr__   s    

|1%%rK   c                 v    U R                   R                  U R                   R                  U R                        $ )zA label is an opaque value that associates each span with its
approximate origin, such as a particular strategy class or a particular
kind of draw.)rz   labelslabel_indicesry   rW   s    rI   rk   
Span.label   s,    
 zz  !9!9$**!EFFrK   c                 j    U R                   S:X  a  gU R                  R                  U R                      $ )z>The index of the span that this one is nested directly within.r   N)ry   rz   	parentagerW   s    rI   parentSpan.parent   s+     ::?zz##DJJ//rK   c                 H    U R                   R                  U R                     $ rp   )rz   startsry   rW   s    rI   start
Span.start   s    zz  ,,rK   c                 H    U R                   R                  U R                     $ rp   )rz   endsry   rW   s    rI   endSpan.end   s    zztzz**rK   c                 H    U R                   R                  U R                     $ )zK
Depth of this span in the span tree. The top-level span has a depth of 0.
)rz   depthsry   rW   s    rI   depth
Span.depth   s    
 zz  ,,rK   c                 H    U R                   U R                  R                  ;   $ )a;  True if this is span's ``stop_span`` call had ``discard`` set to
``True``. This means we believe that the shrinker should be able to delete
this span completely, without affecting the value produced by its enclosing
strategy. Typically set when a rejection sampler decides to reject a
generated value and try again.)ry   rz   	discardedrW   s    rI   r   Span.discarded   s     zzTZZ1111rK   c                 4    U R                   U R                  -
  $ )z#The number of choices in this span.)r   r   rW   s    rI   choice_countSpan.choice_count   s     xx$**$$rK   c                     U R                   R                  U R                      Vs/ s H  oR                   U   PM     sn$ s  snf )zGThe list of all spans with this as a parent, in increasing index
order.)rz   childrenry   rX   is     rI   r   Span.children   s7     (,zz':':4::'FG'F!

1'FGGGs   A)r@   z
list[Span])r\   r]   r^   r_   __doc__	__slots__rl   r}   objectboolr   r   rd   rY   propertyrk   r   r   r   r   r   r   r   re   r[   rK   rI   rw   rw      s:   6 #Ig c d KF Kt KNF Nt N&# & Gs G G 0d
 0 0 -s - - +S + + -s - - 24 2 2 %c % % H HrK   rw   c                       \ rS rSrSrSS jrS\4S jrS\SS4S jr	S	\
SS4S
 jrS\S\SS4S jrS\S	\
SS4S jrS\4S jrSrg)SpanProperty   zThere are many properties of spans that we calculate by
essentially rerunning the test case multiple times based on the
calls which we record in SpanProperty.

This class defines a visitor, subclasses of which can be used
to calculate these properties.
c                 :    / U l         Xl        SU l        SU l        g Nr   )
span_stackspans
span_countr   )rX   r   s     rI   r}   SpanProperty.__init__   s    %'
rK   r@   c                    U R                   R                   H  nU[        R                  :X  a  U R	                  SS9  M(  U[        R
                  :X  a  U R	                  SS9  MM  U[        R                  :X  a  U =R                  S-  sl        Mx  U R                  U[        R                  -
  S-
  5        M     U R                  5       $ )zRRerun the test case with this visitor and return the
results of ``self.finish()``.Tr   FrC   )
r   trail	TrailTypeSTOP_SPAN_DISCARD_SpanProperty__popSTOP_SPAN_NO_DISCARDCHOICEr   _SpanProperty__pushfinishrX   records     rI   runSpanProperty.run  s     jj&&F444

T
*9999

U
+9+++!!Q&! FY%5%559: ' {{}rK   label_indexNc                     U R                   nU[        U R                  5      :  d   eU R                  X!S9  U =R                   S-  sl         U R                  R                  U5        g )N)r   rC   )r   lenr   
start_spanr   append)rX   r   r   s      rI   __pushSpanProperty.__push  sO    OO3tzz?"""31q!rK   r   c                V    U R                   R                  5       nU R                  X!S9  g )Nr   )r   pop	stop_span)rX   r   r   s      rI   __popSpanProperty.__pop  s"    OO!q.rK   r   c                     g)zCalled at the start of each span, with ``i`` the
index of the span and ``label_index`` the index of
its label in ``self.spans.labels``.Nr[   rX   r   r   s      rI   r   SpanProperty.start_span      rK   c                    g)zCalled at the end of each span, with ``i`` the
index of the span and ``discarded`` being ``True`` if ``stop_span``
was called with ``discard=True``.Nr[   rX   r   r   s      rI   r   SpanProperty.stop_span"  r   rK   c                     [         erp   )NotImplementedErrorrW   s    rI   r   SpanProperty.finish'  s    !!rK   )r   r   r   r   )r   r{   )r\   r]   r^   r_   r   r}   r   r   rl   r   r   r   r   r   r   re   r[   rK   rI   r   r      s~    S  "# "$ "/$ /4 //C /c /d /
-3 -d -t -
" "rK   r   c                        \ rS rSrSrSrSrSrg)r   i+  rC   rT   rU   r[   N)r\   r]   r^   r_   r   r   r   re   r[   rK   rI   r   r   +  s    FrK   r   c                   Z    \ rS rSrSrSS jrSS jrSS jrS\SS4S	 jr	S
\
SS4S jrSrg)
SpanRecordi4  a  Records the series of ``start_span``, ``stop_span``, and
``draw_bits`` calls so that these may be stored in ``Spans`` and
replayed when we need to know about the structure of individual
``Span`` objects.

Note that there is significant similarity between this class and
``DataObserver``, and the plan is to eventually unify them, but
they currently have slightly different functions and implementations.
r@   Nc                 L    / U l         0 U l        [        5       U l        / U l        g rp   )r   _SpanRecord__index_of_labelsr*   r   nodesrW   s    rI   r}   SpanRecord.__init__?  s!    !#8:Y
')
rK   c                     S U l         g rp   )r   rW   s    rI   freezeSpanRecord.freezeE  s
    !%rK   c                 V    U R                   R                  [        R                  5        g rp   )r   r   r   r   rW   s    rI   record_choiceSpanRecord.record_choiceH  s    

)**+rK   rk   c                 T   U R                   c   e U R                   U   nU R                  R                  [        R                  S-   U-   5        g ! [         aM    U R                   R                  U[        U R                  5      5      nU R                  R                  U5         Nf = fNrC   )	r   rq   rr   r   r   r   r   r   r   )rX   rk   r   s      rI   r   SpanRecord.start_spanK  s    %%111	&&&u-A 	

)**Q.23  	&&&11%T[[9IJAKKu%	&s   A AB'&B'discardc                    U(       a*  U R                   R                  [        R                  5        g U R                   R                  [        R                  5        g rp   )r   r   r   r   r   )rX   r   s     rI   r   SpanRecord.stop_spanT  s5    JJi99:JJi<<=rK   )__index_of_labelsr   r   r   r@   N)r\   r]   r^   r_   r   r}   r   r   rl   r   r   r   re   r[   rK   rI   r   r   4  s<    *&,4 4 4>D >T >rK   r   c                   p   ^  \ rS rSrSU 4S jjrS\S\SS4S jrS\S\SS4S	 jrS\	\
\
4   4S
 jrSrU =r$ )_starts_and_endsi[  r@   Nc                    > [         TU ]  U5        [        R                  " [	        U R
                  5      5      U l        [        R                  " [	        U R
                  5      5      U l        g rp   )superr}   r*   	of_lengthr   r   r   r   rX   r   	__class__s     rI   r}   _starts_and_ends.__init__\  sD    ''DJJ8%%c$**o6	rK   r   r   c                 6    U R                   U R                  U'   g rp   )r   r   r   s      rI   r   _starts_and_ends.start_spana  s    **ArK   r   c                6    U R                   U R                  U'   g rp   )r   r   r   s      rI   r   _starts_and_ends.stop_spand  s    ((		!rK   c                 2    U R                   U R                  4$ rp   )r   r   rW   s    rI   r   _starts_and_ends.finishg  s    TYY''rK   )r   r   r   r{   r@   N)r\   r]   r^   r_   r}   rl   r   r   r   tupler*   r   re   __classcell__r   s   @rI   r   r   [  sW    7
+C +c +d +)3 )d )t )(gw./ ( (rK   r   c                   V   ^  \ rS rSrS
U 4S jjrS\\   4S jrS\S\SS4S jr	S	r
U =r$ )
_discardedik  r@   Nc                 B   > [         TU ]  U5        [        5       U l        g rp   )r   r}   setresultr   s     rI   r}   _discarded.__init__l  s     #rK   c                 ,    [        U R                  5      $ rp   )	frozensetr	  rW   s    rI   r   _discarded.finishp  s    %%rK   r   r   c                J    U(       a  U R                   R                  U5        g g rp   )r	  addr   s      rI   r   _discarded.stop_spans  s    KKOOA rK   r	  r  )r\   r]   r^   r_   r}   r  rl   r   r   r   re   r  r  s   @rI   r  r  k  s7    &&	# &3 d t  rK   r  c                   P   ^  \ rS rSrS
U 4S jjrS\S\SS4S jrS\4S jr	S	r
U =r$ )
_parentageix  r@   Nc                    > [         TU ]  U5        [        R                  " [	        U R
                  5      5      U l        g rp   r   r}   r*   r   r   r   r	  r   s     rI   r}   _parentage.__init__y  *    ''DJJ8rK   r   r   c                J    US:  a  U R                   S   U R                  U'   g g )Nr   )r   r	  r   s      rI   r   _parentage.stop_span}  s$    q5!__R0DKKN rK   c                     U R                   $ rp   r  rW   s    rI   r   _parentage.finish      {{rK   r  r  )r\   r]   r^   r_   r}   rl   r   r   r*   r   re   r  r  s   @rI   r  r  x  s3    913 1d 1t 1  rK   r  c                   P   ^  \ rS rSrS
U 4S jjrS\S\SS4S jrS\4S jrS	r	U =r
$ )_depthsi  r@   Nc                    > [         TU ]  U5        [        R                  " [	        U R
                  5      5      U l        g rp   r  r   s     rI   r}   _depths.__init__  r  rK   r   r   c                 H    [        U R                  5      U R                  U'   g rp   )r   r   r	  r   s      rI   r   _depths.start_span  s    T__-ArK   c                     U R                   $ rp   r  rW   s    rI   r   _depths.finish  r  rK   r  r  r\   r]   r^   r_   r}   rl   r   r*   r   re   r  r  s   @rI   r  r    s3    9.C .c .d .  rK   r  c                   P   ^  \ rS rSrS
U 4S jjrS\S\SS4S jrS\4S jrS	r	U =r
$ )_label_indicesi  r@   Nc                    > [         TU ]  U5        [        R                  " [	        U R
                  5      5      U l        g rp   r  r   s     rI   r}   _label_indices.__init__  r  rK   r   r   c                      X R                   U'   g rp   r  r   s      rI   r   _label_indices.start_span  s    $ArK   c                     U R                   $ rp   r  rW   s    rI   r   _label_indices.finish  r  rK   r  r  r&  r  s   @rI   r(  r(    s3    9%C %c %d %  rK   r(  c                   f   ^  \ rS rSrS
U 4S jjrS\S\SS4S jrS\\\	\\4         4S jr
S	rU =r$ )_mutator_groupsi  r@   Nc                 L   > [         TU ]  U5        [        [        5      U l        g rp   )r   r}   r   r  groupsr   s     rI   r}   _mutator_groups.__init__  s    7B37GrK   r   r   c                     U R                   U   R                  U R                   U   R                  4nU R                  U   R	                  U5        g rp   )r   r   r   r2  r  )rX   r   r   keys       rI   r   _mutator_groups.start_span  sA     zz!}""DJJqM$5$56K $$S)rK   c                     U R                   R                  5        Vs/ s H  n[        U5      S:  d  M  UPM     sn$ s  snf )NrT   )r2  valuesr   )rX   gs     rI   r   _mutator_groups.finish  s5      ;;--/?/a3q6Q;/???s   ==)r2  r  )r\   r]   r^   r_   r}   rl   r   r   r  r  r   re   r  r  s   @rI   r0  r0    sI    H*C *c *d *@U38_!56 @ @rK   r0  c                   h   \ rS rSrSrS\SS4S jr\S\\	\	4   4S j5       r
\S\	4S j5       r\S\	4S	 j5       r\S\\   4S
 j5       r\S\	4S j5       r\S\	4S j5       r\S\	4S j5       r\S\\\\\4         4S j5       r\S\\\      4S j5       rS\4S jrS\S\4S jrS\\   4S jrSrg)r{   i  af  A lazy collection of ``Span`` objects, derived from
the record of recorded behaviour in ``SpanRecord``.

Behaves logically as if it were a list of ``Span`` objects,
but actually mostly exists as a compact store of information
for them to reference into. All properties on here are best
understood as the backing storage for ``Span`` and are
described there.
r   r@   Nc                    UR                   U l         UR                  U l        U R                   R                  [        R                  5      UR                   R                  [        R
                  5      -   U l        S U l        g rp   )r   r   countr   r   r   _Spans__length_Spans__childrenr   s     rI   r}   Spans.__init__  s]    \\
mm

((''
LLy==>? 7;rK   c                 4    [        U 5      R                  5       $ rp   )r   r   rW   s    rI   starts_and_endsSpans.starts_and_ends  s    %))++rK   c                      U R                   S   $ r   rB  rW   s    rI   r   Spans.starts      ##A&&rK   c                      U R                   S   $ r   rE  rW   s    rI   r   
Spans.ends  rG  rK   c                 4    [        U 5      R                  5       $ rp   )r  r   rW   s    rI   r   Spans.discarded      $##%%rK   c                 4    [        U 5      R                  5       $ rp   )r  r   rW   s    rI   r   Spans.parentage  rL  rK   c                 4    [        U 5      R                  5       $ rp   )r  r   rW   s    rI   r   Spans.depths  s    t}  ""rK   c                 4    [        U 5      R                  5       $ rp   )r(  r   rW   s    rI   r   Spans.label_indices  s    d#''))rK   c                 4    [        U 5      R                  5       $ rp   )r0  r   rW   s    rI   mutator_groupsSpans.mutator_groups  s    t$((**rK   c                 V   U R                   c  [        [        U 5      5       Vs/ s H  n[        5       PM     nn[	        U R
                  5       H   u  p4US:  d  M  X$   R                  U5        M"     [	        U5       H  u  p5U(       a  M  SX#'   M     X l         U R                   $ s  snf )Nr   r[   )r?  ranger   r*   	enumerater   r   )rX   _r   r   pcs         rI   r   Spans.children  s    ??"+0T+;<+;a	+;H<!$..1q5K&&q) 2
 "(+q"$HK , 'O =s   B&c                     U R                   $ rp   )r>  rW   s    rI   __len__Spans.__len__  s    }}rK   r   c           	          U R                   nX* :  d  X:  a  [        SU SU SU S35      eUS:  a  X-  n[        X5      $ )NzIndex z out of range [-z, )r   )r>  
IndexErrorrw   )rX   r   ns      rI   __getitem__Spans.__getitem__  sO    MMr6QVvaS(82aSBCCq5FAD}rK   c              #   N   #    [        [        U 5      5       H	  nX   v   M     g 7frp   )rW  r   r   s     rI   __iter__Spans.__iter__  s     s4y!A'M "s   #%)
__children__lengthr   r   )r\   r]   r^   r_   r   r   r}   r   r  r*   rB  r   r   r   r  rl   r   r   r   r   listr  rT  r   r   r^  rw   rd  r   rg  re   r[   rK   rI   r{   r{     se   ;z ;d ; ,w'7!8 , , ' ' ' 'g ' ' &9S> & & &7 & & # # # *w * * +SsCx%9 : + + $x}-   S T (4. rK   r{   c                   F    \ rS rSr% \R
                  r\\S'   S\4S jr	Sr
g)_Overruni  statusr@   c                     g)NOverrunr[   rW   s    rI   rY   _Overrun.__repr__  s    rK   r[   N)r\   r]   r^   r_   rR   r`   rn  rm   rd   rY   re   r[   rK   rI   rm  rm    s    ^^FF## rK   rm  c                       \ rS rSrSrS\S\S-  SS4S jrSS jrS	\	S
\
S\SS4S jrS	\S
\S\SS4S jrS	\S
\S\SS4S jrS	\S
\S\SS4S jrS	\S
\S\SS4S jrSrg)DataObserveri  zObserver class for recording the behaviour of a
ConjectureData object, primarily used for tracking
the behaviour in the tree cache.rn  interesting_originNr@   c                     g)zCalled when ``conclude_test`` is called on the
observed ``ConjectureData``, with the same arguments.

Note that this is called after ``freeze`` has completed.
Nr[   rX   rn  rt  s      rI   conclude_testDataObserver.conclude_test  r   rK   c                     g)z5Mark this part of the tree as not worth re-exploring.Nr[   rW   s    rI   kill_branchDataObserver.kill_branch  r   rK   valueconstraints
was_forcedc                    g rp   r[   rX   r|  r}  r~  s       rI   draw_integerDataObserver.draw_integer        	rK   c                    g rp   r[   r  s       rI   
draw_floatDataObserver.draw_float%  r  rK   c                    g rp   r[   r  s       rI   draw_stringDataObserver.draw_string*  r  rK   c                    g rp   r[   r  s       rI   
draw_bytesDataObserver.draw_bytes/  r  rK   c                    g rp   r[   r  s       rI   draw_booleanDataObserver.draw_boolean4  r  rK   r[   r   )r\   r]   r^   r_   r   rR   r0   rw  rz  rl   r$   r   r  floatr#   r  rd   r%   r  bytesr   r  r   r  re   r[   rK   rI   rs  rs    s    (		 .4	 
		D*<JN	
,<JN	
*;IM	
,<JN	
+=KO	rK   rs  c                   z   \ rS rSr% Sr\\S'   \S-  \S'   \" SSS9r	\
\S4   \S	'   \\S
'   \\S'   \S-  \S'   \S-  \S'   \\S'   \\S'   \\   \S'   \" SSS9r\\S'   \" SS9r\\
\\4      \S'   \" SS9r\\
\\4   \4   \S'   \" SS9r\S-  \S'   \" SS9r\S-  \S'   SS jr\S\
\S4   4S j5       r Sr!g)ConjectureResulti:  zResult class storing the parts of ConjectureData that we
will care about after the original ConjectureData has outlived its
usefulness.rn  Nrt  F)reprcompare.r   lengthoutputexpected_exceptionexpected_tracebackhas_discardstarget_observationstagsr   )r  
arg_slicesslice_commentsmisaligned_atcannot_proceed_scoper@   c                     U $ rp   r[   rW   s    rI   	as_resultConjectureResult.as_resultP  s    rK   c                 :    [        S U R                   5       5      $ )Nc              3   8   #    U  H  oR                   v   M     g 7frp   r|  .0nodes     rI   	<genexpr>+ConjectureResult.choices.<locals>.<genexpr>U       7JDZZJ   r  r   rW   s    rI   choicesConjectureResult.choicesS      7DJJ777rK   r[   )r@   r  )"r\   r]   r^   r_   r   rR   rm   r0   r	   r   r  r   rl   rd   BaseExceptionr   TargetObservationsr  ri   r   r{   r  r  r  dictr  rM   r  r   r  r   r    r  re   r[   rK   rI   r  r  :  s    N)D00$)ue$DE5S!DKK%,,d
"++
)
**eU3E53',%'8JE#s(O$816E1BNDsCx#-.B).E):M<$&:7<%7H-4H 8w|, 8 8rK   r  c                      \ rS rSr\S\SS.S\\\-     S\	S-  S\
\\
   -  S\S-  SS 4
S	 jj5       rS\SSSS
.S\S-  S\	S-  S\
\\
   -  S\\\-     S-  S\S-  S\\\4   S-  SS4S jjrS\4S jr\S\\S4   4S j5       r\S\S   S\S\S\S-  S\4
S j5       r\S\S   S\S\S\S-  S\4
S j5       r\S\S   S\S\S\S-  S\4
S j5       r\S\S   S\S\S\ S-  S\ 4
S j5       r\S\S   S\!S\S\S-  S\4
S j5       rS\"S\#S\S\S-  S\4
S  jr  SYSS!SS"S#.S$\S-  S%\S-  S&\\\4   S-  S'\S\S-  S\S\4S( jjjr$\%RL                  * \%RL                  4S"\'SS"S).S$\S%\S*\S+\S\S-  S\S\4S, jjjr(S!\)SS"S-.S.\*S/\S0\S\S-  S\S\4S1 jjr+S!\)4SS"S2.S/\S0\S\ S-  S\S\ 4
S3 jjjr, SZSS"S2.S4\S\S-  S\S\4S5 jjjr-\S\S   S\S\4S6 j5       r.\S\S   S\S\4S7 j5       r.\S\S   S\S\4S8 j5       r.\S\S   S\S\4S9 j5       r.\S\S   S\!S\!4S: j5       r.S\"S\#S\#4S; jr.S\"S\#S\S-  S\4S< jr/S\0\1-  4S= jr2S>\SS4S? jr3S@\SS4SA jr4  SYSBSCSD\S-  SE\S-  SSF4SG jjr5SD\SS4SH jr6SISJ.SK\SS4SL jjr7\S\84SM j5       r9S[SN jr:SS"S2.SO\\;   S\;S-  S\S\;4SP jjr< S\SQ\=SR\>S-  S\?4SS jjr@SR\>S\?4ST jrAS\SU\S-  S\?4SV jjrBS\?4SW jrCSXrDg)]ConjectureDataiX  N)observerproviderrandomr  r  r  r  r@   c                .    SSK Jn  U " U" U5      UUUUS9$ )Nr   )r   )max_choicesr  prefixr  r  )%hypothesis.internal.conjecture.enginer   )clsr  r  r  r  r   s         rI   for_choicesConjectureData.for_choicesY  s)     	G$W-
 	
rK   )r  r  r  r  provider_kwr  r  r  c                   SSK Jn  Uc
  [        5       nUc  0 nO)[        U[        5      (       d  [        SU< SU< S35      e[        U[        5      (       d   eX l        XPl        Xpl        SU l	        Xl
        SU l        SU l        SU l        [        R                  U l        SU l        [$        R&                  U l        [$        =R&                  S-  sl        [*        R,                  " 5       U l        [1        5       U l        0 U l        S U l        0 U l        [;        [<        5      U l        SU l         SU l!        [        U[        5      (       a	  U" U 40 UD6OUU l"        [        U RD                  [F        5      (       d   eS U l$        0 U l%        [M        5       U l'        / U l(        S U l)        S	U l*        [W        5       U l,        [M        5       U l-        0 U l.        0 U l/        [;        [`        5      U l1        S U l2        0 U l3        S U l4        S U l5        S U l6        S U l7        [p        U l9        S U l:        S U l;        X@l<        S
U l=        S U l>        S U l?        U R                  [        5        g )Nr   )BUFFER_SIZEzExpected provider=z! to be a class since provider_kw=z) was passed, but got an instance instead. FrC   r  r[   )Br  r  rs  r   typer   r  r  
max_lengthoverdraw_randomr  ry   r  rR   rb   rn  rg   threadlocalrP   testcountertimeperf_counter
start_timer+   gc_start_timeeventsrt  
draw_timesr   r  _stateful_run_times	max_depthr  r  r.   _ConjectureData__resultr  r  r  labels_for_structure_stack_ConjectureData__spansr   r   _ConjectureData__span_recordr  r  _observability_argsr6   _observability_predicates-_sampled_from_all_strategies_elements_message_shared_strategy_draws_shared_data_strategy_stateful_repr_partsstates_for_idsseeds_to_statesr8   hypothesis_runnerr  r  r  r   r  r  r   	TOP_LABEL)rX   r  r  r  r  r  r  r  s           rI   r}   ConjectureData.__init__l  s:    	F#~HKHd++!%H;&HK> J7 7 
 (L1111 &%
$ll! + ? ?''1,'++-/146<@,.5@5G "' .8$-G-GHT)[)X 	 $--):;;;;15 8:  14	:<'
 &* 
'\ 14:<35 LWM
&  	: SU#8<"6:!=A>B&-8<.2-/
26@D!	"rK   c                     SU R                   R                  [        U R                  5      U R                  (       a  S4-  $ S4-  $ )Nz ConjectureData(%s, %d choices%s)z, frozenr  )rn  r?   r   r   rg   rW   s    rI   rY   ConjectureData.__repr__  sI    1KK

O++J5
 
 	
 ,.5
 
 	
rK   .c                 :    [        S U R                   5       5      $ )Nc              3   8   #    U  H  oR                   v   M     g 7frp   r  r  s     rI   r  )ConjectureData.choices.<locals>.<genexpr>  r  r  r  rW   s    rI   r  ConjectureData.choices  r  rK   choice_typeintegerr}  observeforcedc                    g rp   r[   rX   r  r}  r  r  s        rI   _drawConjectureData._draw       rK   r  c                    g rp   r[   r  s        rI   r  r         rK   stringc                    g rp   r[   r  s        rI   r  r    r  rK   r  c                    g rp   r[   r  s        rI   r  r     r  rK   booleanc                    g rp   r[   r  s        rI   r  r  
  s     rK   c          	         U R                   U R                  :X  a)  [        SU R                  < 35        U R                  5         [	        U R
                  5      U R                  :X  a)  [        SU R                  < 35        U R                  5         U(       aA  U R                  b4  U R                  [	        U R                  5      :  a  U R                  XUS9nO"Uc  [        U R                  SU 35      " S0 UD6nUb  UnUS:X  aF  [        W[        5      (       d   e[        R                  " U5      (       a  [!        [#        U5      5      nU(       Ga  US Ln[        U R$                  SU 35      " WX&S9  U R                  R&                  (       a  SO[)        U/5      nU R                   U-   U R                  :  a;  [        SU R                   < S	U< S
U R                  < 35        U R                  5         [+        UUUU[	        U R
                  5      S9nU R,                  R/                  5         U =R
                  U4-  sl        U =R                   U-  sl         W$ )Nz$overrun because hit self.max_length=z%overrun because hit self.max_choices=)r  draw_r  )r}  r~  r   zoverrun because self.length=z + size=z > self.max_length=)r  r|  r}  r~  ry   r[   )r  r  r7   mark_overrunr   r   r  r  ry   _pop_choicegetattrr  r   r  mathisnanr3   r2   r  avoid_realizationr)   r   r  r   )	rX   r  r}  r  r  r|  r~  sizer  s	            rI   r  r    s    ;;$//)@/ABCtzz?d...A0@0@/BCDt{{.4::DKK@P3P$$[f$ME^DMMU;-+@APKPEE, '!eU++++zz%  $\%%89t+JDMMU;-#89; 771\5'=RD{{T!DOO33t{{nIw>R$//AST !!# '%$**oD ,,.JJ4'!JKK4KrK   r   T)weightsshrink_towardsr  r  	min_value	max_valuer  r  c                N   Uba  Uc   eUc   e[        U5      S::  d   e[        UR                  5       5      S:  d   e[        S UR                  5        5       5      (       d   eUb
  Ub  X::  d   eUb
  Ub  XR::  d   eU R	                  SUUUUS.5      nU R                  SXvUS9$ )N   rC   c              3   *   #    U  H	  oS :g  v   M     g7f)r   Nr[   )r  ws     rI   r  .ConjectureData.draw_integer.<locals>.<genexpr>u  s     8'7!Av'7s   r  )r  r  r  r  r  r  )r   sumr8  all_pooled_constraintsr  )rX   r  r  r  r  r  r  r}  s           rI   r  ConjectureData.draw_integer`  s     ((((((w<3&&& w~~'(1,,, 8w~~'788888)"7&&&)"7&&&*.*B*B&&""0	+
 zz)[&zQQrK   )	allow_nansmallest_nonzero_magnituder  r  r  r  c                   US:  d   e[         R                  " U5      (       a   e[         R                  " U5      (       a   eUS:X  a  [        S5      eUba  U(       d  [         R                  " U5      (       a   e[         R                  " U5      (       d"  [        X5      (       a  [        XR5      (       d   eU R	                  SUUUUS.5      nU R                  SXvUS9$ )Nr   g        a_  Got allow_subnormal=True, but we can't represent subnormal floats right now, in violation of the IEEE-754 floating-point specification.  This is usually because something was compiled with -ffast-math or a similar option, which sets global processor state.  See https://simonbyrne.github.io/notes/fastmath/ for a more detailed writeup - and good luck!r  )r  r  r  r  r
  )r  r  FloatingPointErrorr4   r  r  )rX   r  r  r  r  r  r  r}  s           rI   r  ConjectureData.draw_float  s     *A---::i((((::i((((%,$+  DJJv$6$666::f%%y11nV6W6W  )-(@(@&&&.H	)
 zz';zOOrK   )min_sizemax_sizer  r  	intervalsr  r  c                    Ub  U[        U5      s=::  a  U::  d   e   eUS:  d   e[        U5      S:X  a  US:X  d   eU R                  SUUUS.5      nU R                  SXeUS9$ )Nr   r  )r  r  r  r
  r   r  r  )rX   r  r  r  r  r  r}  s          rI   r  ConjectureData.draw_string  s     ~S[!DH!DDD!DDD1}}y>Qq= =)-)A)A&$$*
 zz(KzPPrK   r  r  c                    Ub  U[        U5      s=::  a  U::  d   e   eUS:  d   eU R                  SXS.5      nU R                  SXTUS9$ )Nr   r  )r  r  r
  r  )rX   r  r  r  r  r}  s         rI   r  ConjectureData.draw_bytes  sc     ~S[!DH!DDD!DDD1}}(,(@(@(A)
 zz';zOOrK   rZ  c                    USLd  US:  d   eUSLd  US:  d   eU R                  SSU05      nU R                  SXCUS9$ )NTr   FrC   r  rZ  r
  )r  r  )rX   rZ  r  r  r}  s        rI   r  ConjectureData.draw_boolean  sX     d"q1u,,e#A--*.*B*B9sTUh*Wzz)[&zQQrK   c                     g rp   r[   rX   r  r}  s      rI   r  "ConjectureData._pooled_constraints       !rK   c                     g rp   r[   r   s      rI   r  r!         rK   c                     g rp   r[   r   s      rI   r  r!    s      rK   c                     g rp   r[   r   s      rI   r  r!    r$  rK   c                     g rp   r[   r   s      rI   r  r!    r"  rK   c                     U R                   R                  (       a  U$ U/[        X5      Q7n [        U   $ ! [         a    U[        U'   Us $ f = f)z<Memoize common dictionary objects to reduce memory pressure.)r  r  r&   ru   rq   )rX   r  r}  r5  s       rI   r  r!    sZ    
 ==**N3KMN	+C00 	,7$S)	s   7 AAc          
         U R                   c   eU R                  [        U R                   5      :  d   eU R                   U R                     n[        U[        5      (       a  UnUR
                  b  UR
                  S:  d   eU R                  [        U R                   5      S-
  :X  d   eUR                  S:X  a  Ub  Un [        SX5      nO[        eUR
                  b5  U=R
                  S-  sl        UR
                  S:  a  U R                  5         W$ Un[        S[        S[        S[        S[        S0[        U5         nXq:w  d  [!        Xb5      (       d.  U R"                  c  U R                  XU4U l         [        SX5      nU =R                  S-  sl        U$ ! [         a    U R                  5          Nf = f! [         a    U R                  5          NSf = f)	Nr   rC   simplestr  r  r  r  r  )r  ry   r   r   r!   r=  r  r'   r   r  r   rd   r  rl   r   r  r(   r  )rX   r  r}  r  r|  r  choicenode_choice_types           rI   r  ConjectureData._pop_choice  s    {{&&&zzC,,,,DJJ'e^,,#(Dzz%zzQ& ::T[[!1A!5555yyJ&%#F(.q+KF *)zz%

a
::>%%'M7)7
 v,. *2B62W2W!!)&*jj+F%S"$" +1kG
 	

a
} & (%%'(r " $!!#$s$   F! >G !F>=F>GGc                 6   U R                   (       d   eU R                  [        R                  :X  a  [        $ U R
                  c  [        U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  [!        U R"                  5      U R$                  U R&                  U R(                  U R*                  S9U l        U R
                  c   eU R
                  $ )z\Convert the result of running this test into
either an Overrun object or a ConjectureResult.)rn  rt  r   r   r  r  r  r  r  r  r  r  r  r  r  )rg   rn  rR   r`   rp  r  r  rt  r   r   r  r  r  r  r  r  r  r  r  r  r  r  rW   s    rI   r  ConjectureData.as_resulti  s     {{{;;&..(N== ,{{#'#:#:jjjj{{{{#'#:#:#'#:#:!..$($<$<tyy)??#22"00%)%>%>DM" ==,,,}}rK   r?   c                 D    U R                   (       a  [        SU S35      eg )NzCannot call z on frozen ConjectureData)rg   r   )rX   r?   s     rI   __assert_not_frozen"ConjectureData.__assert_not_frozen  s#    ;;<v-FGHH rK   r|  c                     U R                  S5        [        U[        5      (       d  [        U5      nU =R                  U-  sl        g )Nnote)"_ConjectureData__assert_not_frozenr   rd   r  r  )rX   r|  s     rI   r4  ConjectureData.note  s4      (%%%KEurK   strategyzSearchStrategy[Ex]rk   
observe_asr>   c                    SSK Jn  SSKJn  SSKJn  U R                  S:H  nS nU(       a  [        R                  " 5       n[        5       n	UR                  5         UR                  (       a  U R                  SU < 35        U R                  [        :  a  U R                  S5        U" U5      n
Uc#  U
R                  n[        U[         5      (       d   eU R#                  US9   U(       d!  U
R%                  U 5      U R'                  5         $ Uc   eU=(       d    S[)        U R*                  5       3n  U
R%                  U 5      n[        5       W	-
  n[        R                  " 5       U-
  U-
  U R*                  U'   U" 5       (       a)  U R2                  R4                  nU" XS9U R6                  U'   UU R'                  5         $ ! [        5       W	-
  n[        R                  " 5       U-
  U-
  U R*                  U'   f = f! [,         a)  n[/        US	UR1                  S
5      < SU< 35        e S nAff = f! U R'                  5         f = f)Nr   )observability_enabled)unwrap_strategies)to_jsonablezempty strategy zmax depth exceededrs   zgenerate:unlabeled_zwhile generating z	generate:z from )r  )!hypothesis.internal.observabilityr:  $hypothesis.strategies._internal.lazyr;  %hypothesis.strategies._internal.utilsr<  r   r  r  r+   validateis_emptymark_invalid	MAX_DEPTHrk   r   rl   r   do_drawr   r   r  	Exceptionr   removeprefixr  r  r  )rX   r7  rk   r8  r:  r;  r<  at_top_levelr  r  	unwrappedr5  v	in_gctimeerravoids                   rI   drawConjectureData.draw  s    	LJEzzQ

 **,J.0Mx89::"23 &h/	=OOEeS))))e$	 ((., NN+ )))L"5c$//6J5K LCX!))$/A !3 4} DI+/+<+<+>+Ki+WDOOC( %&&770;A0W((-NN !3 4} DI+/+<+<+>+Ki+WDOOC( '(8(8(E'Hxl[  NNsH   #H0 &H0 3G  5G: 96H0  7G77G: :
H-$H((H--H0 0Ic                 J   U R                   R                  U5        U R                  S5        U =R                  S-  sl        U R                  U R                  :  a  U R                  U l        U R
                  R                  U5        U R                  R                  U15        g )Nr   rC   )	r  
span_startr5  r   r  r  r   r  r   )rX   rk   s     rI   r   ConjectureData.start_span  sv      '  .

a
 ::&!ZZDN%%e,''..w7rK   Fr   r   c                T   U R                   R                  U5        U R                  (       a  g U(       a  SU l        U =R                  S-  sl        U R                  S:  d   eU R
                  R                  US9  U R                  R                  5       nU(       de  U R                  (       a  U R                  S   R                  U5        O5U R                  R                  U Vs/ s H  n[        U5      PM     sn5        U(       a  U R                  R                  5         g g s  snf )NTrC   r  rR  )r  span_endrg   r  r   r  r   r  r   updater  rt   r  rz  )rX   r   labels_for_structurels       rI   r   ConjectureData.stop_span  s    w';; $D

a
zzR$$W$5#>>BBD..//3::;OP		  BV!WBVQ"5a"8BV!WX2 MM%%'3  "Xs   &D%c                     U R                   (       d   eU R                  c  [        U R                  S9U l        U R                  $ )N)r   )rg   r  r{   r  rW   s    rI   r   ConjectureData.spans	  s4    {{{<< (:(:;DL||rK   c                    U R                   (       a  g [        R                  " 5       U l        [	        5       U l        U R                  S:  a"  U R                  5         U R                  S:  a  M"  U R                  R                  5         SU l         U R                  R                  U R                  U R                  5        g )Nr   T)rg   r  r  finish_timer+   gc_finish_timer   r   r  r   r  rw  rn  rt  rW   s    rI   r   ConjectureData.freeze  s    ;;,,.02 jjAoNN jjAo 	!!###DKK1H1HIrK   r8  c                r    Uc  S OUR                  U5      nU R                  S[        U5      S-
  UUS9nX   $ )Nr   rC   r  )ry   r  r   )rX   r8  r  r  forced_ir   s         rI   r+  ConjectureData.choice  sK     ">4v||F/CK!O	  
 yrK   rn  rt  c                     Ub  U[         R                  :X  d   eU R                  S5        X l        Xl        U R                  5         [        U R                  5      e)Nrw  )rR   rc   r5  rt  rn  r   r   r  rv  s      rI   rw  ConjectureData.conclude_test.  sP    
 #*&:L:L0LMM  1"4t''((rK   c                 D    U R                  [        R                  U5        g rp   )rw  rR   rc   )rX   rt  s     rI   mark_interestingConjectureData.mark_interesting:  s    6--/ABrK   whyc                 d    Ub  XR                   S'   U R                  [        R                  5        g )Nzinvalid because)r  rw  rR   ra   )rX   rg  s     rI   rB  ConjectureData.mark_invalid=  s&    ?-0KK)*6>>*rK   c                 B    U R                  [        R                  5        g rp   )rw  rR   r`   rW   s    rI   r  ConjectureData.mark_overrunB  s    6>>*rK   ).__result__span_record__spansr  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r\  rg   r]  r  r  r  ry   rt  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  rn  r  r  r  )NN)g      ?r   rp   )Er\   r]   r^   r_   classmethodr-   r   r!   r    rs  r.   r  r   r  rl   r  rd   r   r}   rY   r   r  r  r   r   r$   r   r  r#   r  r%   r   r  r   r"   r   r  r  infr1   r  r,   r5   r  r  r  r  r  r  rm  r  r5  r4  rM  r   r   r{   r   r   rL   r+  rR   r0   r   rw  re  rB  r  re   r[   rK   rI   r  r  X  s   
 )-@R $
.723
 %	

 $d+<&==
 
 

 
, )-@R<@"&-1`# `# %	`#
 $d+<&==`# '12T9`# 4Z`# #s(^d*`# 
`#D
# 
 8w|, 8 8 Y' (
  d
 
  W% &
   
  X& '
  d
 
  W% &
   
  Y' (
  t 
 J J (J
 J $J 
J\ !% $%R
 ,0!%R:%R :%R
 c5j!D(%R %R d
%R %R 
%RR !HH988*P
 ,>  $*P*P *P
 *P %**P *P *P 
*P` 3!QQ 	Q
 Q d
Q Q 
Q4 3P
  $PP P
 P P 
P$ R #RR t	R
 R 
R !"9-!<N!	! ! "7+:J	   "8, ;L 	    "7+:J	  !"9-!<N!	! !&5G	W W (W
 $W 
Wr+h6 8I I I# $  !!%	<&< Tz< $J	<
 
<|8 8 8 ,1 +(D +(T +(Z u  J$   D	
  
& 8<
)
) .4
) 
	
)C3D C C+d
 +h +
+h +rK   r  r  r}  r  c                n    [        US9n[        [        [        UR                  SU  35      " S0 UD65      $ )N)r  r  r[   )r  r   r    r  r  )r  r}  r  cds       rI   draw_choicers  F  s5     
v	&Bk].CDS{STTrK   ){r  r  collectionsr   collections.abcr   r   r   r   dataclassesr   r	   enumr
   	functoolsr   r  r   typingr   r   r   r   r   r   r   r   hypothesis.errorsr   r   r   r   r   hypothesis.internal.cacher   hypothesis.internal.compatr   %hypothesis.internal.conjecture.choicer   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   )hypothesis.internal.conjecture.junkdrawerr*   r+   rG   r,   r-   r.   $hypothesis.internal.conjecture.utilsr/   hypothesis.internal.escalationr0   hypothesis.internal.floatsr1   r2   r3   r4    hypothesis.internal.intervalsetsr5   r=  r6   hypothesis.reportingr7   hypothesis.utils.conventionsr8   hypothesis.utils.deprecationr9   hypothesis.utils.threadingr:   hypothesis.strategiesr;   $hypothesis.strategies._internal.corer<   &hypothesis.strategies._internal.randomr=   *hypothesis.strategies._internal.strategiesr>   rd   rJ   rL   r  rl   r  r  r  rM   rm   r  rC  r  rR   ri   rn   rt   ru   rw   r   r   r   r   r  r  r  r(  r0  r{   rm  rp  rs  r  r  rs  r[   rK   rI   <module>r     s     # B B (  % 	 	 	  / /     R 
 F <  9 = - 0 9 24?B=c c $ CL#sU{*+ [2DgPTn TUi U '		c2%W % d#  $ ?A 4%: :; @Ys Y'< Y KSSW. (5c?4F#FG XbH bHJ5" 5"p $> $>N(| ( 
 

 
	l 		\ 	@l @$Q Qh  ** *Z d#8 8 $8:k+ k+\UU+=UJPUUrK   