Ë
    iKêj{$ ã                   óŒ	  — U d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZmZ ddlmZmZmZ ddlmZmZ ddlmZ ddlmZ ddlmZmZ dd	l	mZ dd
lmZm Z m!Z!m"Z"m#Z#m$Z$ ddl%Z%ddl&m'Z'm(Z(m)Z)m*Z+ ddl,m-Z-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZAmBZB ddlCmDZDmEZEmFZFmGZG ddlHmIZImJZJ dZKdZLdj›                  «       ZNeOeP   eQeOeP   df   z  ZReSeTeQeTeTf   z     ZU e)ddde'j¬                  ¬«      ZWdeQeOeP   df   deQeOeP   df   fd „ZXd!eRdeQeOeP   df   fd"„ZYd!eQeOeP   df   deQeUeTf   fd#„ZZd$eTddfd%„Z[d&eTdeQeOeP   df   fd'„Z\d(eTdeOdz  fd)„Z]d*„ Z^d+ej¾                  d,eTde+jÀ                  fd-„Zad.Zbd/Zcd0Zdd1Zed2eTde+jÀ                  fd3„Zfd4edegej¾                     fd5„Zhd4edegej¾                     fd6„Zid4edejeTej¾                  f   fd7„Zkd8eej¾                     dejeTej¾                  f   fd9„ZlejÚ                  d:„ «       Znd;d<œd=ed>eodejeTe+jÀ                  f   fd?„Zpd$eTd@eTdAeTdeTfdB„ZqdC„ ZrdD„ ZsdE„ Zti ZuejeveTf   ewdF<   dG„ ZxdH„ Zyd;dIœdJedKeodeTfdL„ZzePdMdNœd4edOeTd!eRdPeTdeTf
dQ„Z{dReTdeTfdS„Z|dMdddTœd=edUeTdVeTd!eQeOeP   df   dWeTd$eTdXeeTeTe+jÀ                  z  f   dz  dYeUdz  dZeodeQeUeTf   fd[„Z}d\eeT   d=ee   dYeUdeeT   fd]„Z~ G d^„ d_e!«      Zd`ee   dz  dYeUdeTdz  fda„Z€dbeQeTeSeT   f   dz  dceedz     dedz  fdd„Z�dceedz     deQegeT   eSeT   f   dz  fde„Z‚dfededz  fdg„Zƒdhedeofdi„Z„dYeUdjeTdeTfdk„Z…dl„ Z†dmZ‡dnevdejeTef   fdo„Zˆdpdqddrœdsee	�j                  z  d!eRd$eTdZeodz  deTf
dt„ZŠdpdqddrœd4ed!eRd$eTdZeodz  deTf
du„Z‹dpdqddrœd4ed!eRd$eTdZeodz  deTf
dv„ZŒdw„ Z�dpdqddrœd=ed!eRd$eTdZeodz  deTf
dx„ZŽdy„ Z�dz„ Z�d{j›                  «       Z‘d|�j%                  «       Z“d}„ Z”d;dpdqdd~œd=edeod!eRd$eTdZeodz  deTfd€„Z• e"d�«      Z– e"d‚«      Z—dddddpdqddƒœd4ee–e–ge—f   d„eod…eod†e–ez  dz  d‡ee–e–ge–f   dz  d!eRd$eTdZeodz  deTfdˆ„Z˜ddddd‰œd4ee–e–ge—f   d„eod…eod†e–ez  dz  d‡ee–e–ge–f   dz  d!eQeOeP   df   d$eTdZeodeQeUeTf   fdŠ„Z™dpdqddrœd4ed!eRd$eTdZeodz  deTf
d‹„ZšdŒ„ Z›y)�aù
  
Writing tests with Hypothesis frees you from the tedium of deciding on and
writing out specific inputs to test.  Now, the ``hypothesis.extra.ghostwriter``
module can write your test functions for you too!

The idea is to provide **an easy way to start** property-based testing,
**and a seamless transition** to more complex test code - because ghostwritten
tests are source code that you could have written for yourself.

So just pick a function you'd like tested, and feed it to one of the functions
below.  They follow imports, use but do not require type annotations, and
generally do their best to write you a useful test.  You can also use
:ref:`our command-line interface <hypothesis-cli>`::

    $ hypothesis write --help
    Usage: hypothesis write [OPTIONS] FUNC...

      `hypothesis write` writes property-based tests for you!

      Type annotations are helpful but not required for our advanced
      introspection and templating logic.  Try running the examples below to see
      how it works:

          hypothesis write gzip
          hypothesis write numpy.matmul
          hypothesis write pandas.from_dummies
          hypothesis write re.compile --except re.error
          hypothesis write --equivalent ast.literal_eval eval
          hypothesis write --roundtrip json.dumps json.loads
          hypothesis write --style=unittest --idempotent sorted
          hypothesis write --binary-op operator.add

    Options:
      --roundtrip                 start by testing write/read or encode/decode!
      --equivalent                very useful when optimising or refactoring code
      --errors-equivalent         --equivalent, but also allows consistent errors
      --idempotent                check that f(x) == f(f(x))
      --binary-op                 associativity, commutativity, identity element
      --style [pytest|unittest]   pytest-style function, or unittest-style method?
      -e, --except OBJ_NAME       dotted name of exception(s) to ignore
      --annotate / --no-annotate  force ghostwritten tests to be type-annotated
                                  (or not).  By default, match the code to test.
      -h, --help                  Show this message and exit.

.. tip::

    Using a light theme?  Hypothesis respects `NO_COLOR <https://no-color.org/>`__
    and ``DJANGO_COLORS=light``.

.. note::

    The ghostwriter requires :pypi:`black`, but the generated code only
    requires Hypothesis itself.

.. note::

    Legal questions?  While the ghostwriter fragments and logic is under the
    MPL-2.0 license like the rest of Hypothesis, the *output* from the ghostwriter
    is made available under the `Creative Commons Zero (CC0)
    <https://creativecommons.org/public-domain/cc0/>`__
    public domain dedication, so you can use it without any restrictions.
é    N)ÚOrderedDictÚdefaultdict)ÚCallableÚIterableÚMapping)ÚpermutationsÚzip_longest)Ú	iskeyword)Úascii_lowercase)ÚdedentÚindent)ÚEllipsisType)ÚAnyÚ
ForwardRefÚ
NamedTupleÚTypeVarÚget_argsÚ
get_origin)Ú	VerbosityÚfindÚsettingsÚ
strategies)ÚInvalidArgumentÚSmallSearchSpaceWarning)Úget_type_hints)Úget_signatureÚis_mock)Ú
check_type)Údomains)ÚListStrategy)ÚBuildsStrategy)ÚDeferredStrategy)ÚFlatMapStrategy)ÚLazyStrategyÚunwrap_strategies)ÚFilteredStrategyÚMappedStrategyÚOneOfStrategyÚSampledFromStrategy)Ú_global_type_lookupÚis_generic_typez¢
# This test code was written by the `hypothesis.extra.ghostwriter` module
# and is provided under the Creative Commons Zero public domain dedication.

{imports}
zd
@given({given_args})
def test_{test_kind}_{func_name}({arg_names}){return_annotation}:
{test_body}
z4
try:
{test_body}
except {exceptions}:
    reject()
.T)ÚdatabaseÚdeadlineÚderandomizeÚ	verbosityÚexcÚreturnc                 ó´   — t        | «      }t        | d«      D ](  \  }}||v sŒt        ||«      sŒ|j                  |«       Œ* t	        t        |d„ ¬«      «      S )Né   c                 ó   — | j                   S ©N)Ú__name__)Úes    úa/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/hypothesis/extra/ghostwriter.pyú<lambda>z$_dedupe_exceptions.<locals>.<lambda>Ÿ   s
   € ¨q¯z©z€ ó    ©Úkey)Úlistr   Ú
issubclassÚremoveÚtupleÚsorted)r0   ÚuniquesÚaÚbs       r8   Ú_dedupe_exceptionsrE   —   sX   € ô �3‹i€GÜ˜S !Ó$ò ‰ˆˆ1Ø�Š<œJ q¨!Õ,Ø�N‰N˜1Õðô ”˜Ñ%9Ô:Ó;Ð;r:   Úexcept_c                 óh  — t        | t        «      r\t        | «      D ]L  \  }}t        |t        «      rt	        |t
        «      rŒ't        d|› d|›dt        t        |«      «      › d�«      ‚ | S t        | t        «      rt	        | t
        «      s$t        d| ›dt        t        | «      «      › d�«      ‚| fS )Nz&Expected an Exception but got except_[ú]=z (type=ú)z>Expected an Exception or tuple of exceptions, but got except_=)Ú
isinstancer@   Ú	enumerateÚtyper>   Ú	Exceptionr   Ú_get_qualname)rF   Úir7   s      r8   Ú_check_exceptrP   ¢   sº   € Ü�'œ5Ô!Ü˜gÓ&ò 	‰DˆAˆqÜ˜a¤Ô&¬j¸¼IÕ.FÜ%Ø<¸Q¸C¸rÀ!ÀØœm¬D°«GÓ4Ð5°Qð8óð ð	ð ˆÜ�gœtÔ$¬J°wÄ	Ô,JÜØLØˆk˜¤¬t°G«}Ó!=Ð >¸aðAó
ð 	
ð ˆ:Ðr:   c                 óŒ  — | st        «       dfS g }t        «       }t        | «      D ]p  }|j                  t        t        «      v r|j                  |j                  «       Œ:|j                  |j                  «       |j                  t        |d¬«      «       Œr |t        |«      dkD  rddj                  |«      z   dz   fS |d   fS )	NÚ T©Úinclude_moduleé   ú(ú, rI   r   )ÚsetrE   Ú__qualname__ÚdirÚbuiltinsÚappendÚaddÚ
__module__rN   ÚlenÚjoin)rF   Ú
exceptionsÚimportsÚexs       r8   Ú_exception_stringrd   ³   s¼   € ÙÜ‹u�bˆyÐØ€JÜ›€GÜ  Ó)ò FˆØ�?‰?œc¤(›mÑ+Ø×Ñ˜bŸo™oÕ.à�K‰K˜Ÿ™Ô&Ø×Ñœm¨B¸tÔDÕEðFð Ü-0°«_¸qÒ-@ˆˆd�i‰i˜
Ó#Ñ# cÑ)ðð ØFPÐQRÁmðð r:   Ústylec                 ó(   — | dvrt        d| ›�«      ‚y )N)ÚpytestÚunittestz-Valid styles are 'pytest' or 'unittest', got )r   )re   s    r8   Ú_check_styleri   Ã   s#   € ØÐ*Ñ*ÜÐ MÈeÈYÐWÓXÐXð +r:   Údocc                 óf  — t        | t        «      sJ | «       ‚g }t        j                  dt        j                  «      j                  | «      D ]F  }t        t        |d«      }t        |t        «      sŒ%t        |t        «      sŒ6|j                  |«       ŒH t        t        t        |«      «      «      S )zÿReturn a tuple of exceptions that the docstring says may be raised.

    Note that we ignore non-builtin exception types for simplicity, as this is
    used directly in _write_call() and passing import sets around would be really
    really annoying.
    z\:raises\s+(\w+)\:N)rJ   ÚstrÚreÚcompileÚ	MULTILINEÚfindallÚgetattrr[   rL   r>   rM   r\   r@   rE   )rj   ÚraisesÚexcnameÚexc_types       r8   Ú_exceptions_from_docstringru   È   sŒ   € ô �cœ3ÔÐ$ Ó$ÐØ€FÜ—:‘:Ð3´R·\±\ÓB×JÑJÈ3ÓOò $ˆÜœ8 W¨dÓ3ˆÜ�h¤Õ%¬*°X¼yÕ*IØ�M‰M˜(Õ#ð$ô Ô#¤E¨&£MÓ2Ó3Ð3r:   Útokenc                 ót  — | dk(  rt         S dt        j                  v rUt        j                  d| «      rt        j                  d   j
                  S | dk(  rt        j                  d   j                  S t        j                  d| «      }|�Y|j                  «       \  }}t        |«      }|€|j                  d«      rt        |d d «      }|�|dv r	t        |   S t        |«      S d	| vrt        t        | d «      S | j                  d	d
¬«      \  }}t        t        j                  j                  |d «      |d «      S )NÚintegerÚnumpyz[Aa]rray[-_ ]?likeÚdtypez(\w+) of (\w+)Úséÿÿÿÿ)r=   ÚsequenceÚ
collectionú.rU   ©Úmaxsplit)ÚintÚsysÚmodulesrm   Ú	fullmatchÚndarrayrz   ÚgroupsÚ_type_from_doc_fragmentÚendswithr=   rq   r[   ÚrsplitÚget)rv   Ú
coll_matchÚ
coll_tokenÚ
elem_tokenÚelemsÚmodÚnames          r8   rˆ   rˆ   Ú   s"  € à�	ÒÜˆ
Ø”#—+‘+ÑÜ�<‰<Ð-¨uÔ5Ü—;‘;˜wÑ'×/Ñ/Ð/Ø�gÒÜ—;‘;˜wÑ'×-Ñ-Ð-ä—‘Ð/°Ó7€JØÐØ!+×!2Ñ!2Ó!4Ñˆ
�JÜ'¨
Ó3ˆØˆ=˜Z×0Ñ0°Ô5Ü+¨J°s¸¨OÓ<ˆEØÐ Ð/QÑ!QÜ˜‘;Ðô ' zÓ2Ð2à
�%ÑÜ”x ¨Ó-Ð-Ø—‘˜S¨1�Ó-�I€CˆÜ”3—;‘;—?‘? 3¨Ó-¨t°TÓ:Ð:r:   c                 óì   — t        j                  t        «      5  t        | «      D �ch c]  }t	        |«      ’Œ c}t
        hk(  rt        | «      cd d d «       S 	 d d d «       | S c c}w # 1 sw Y   | S xY wr5   )Ú
contextlibÚsuppressrM   r   rL   r   r   )Útype_rC   s     r8   Ú_strip_typevarsr–   ö   se   € Ü	×	Ñ	œYÓ	'ñ %Ü% e›_Ö-˜ŒD��GÒ-´'°Ò:Ü˜eÓ$÷%ñ %Ø:÷%ð €Lùò .÷%ð €Lús   šA)¨A$ºA)Á$A)Á)A3ÚparamÚ	docstringc           	      óø  — d| j                   › d�d| j                   › d�d| j                   › d�fD �]ý  }t        j                  ||t        j                  ¬«      }|€Œ-|j	                  d«      }|j                  d«      j                  d	«      }g }g }t        j                  d
|«      D ]B  }dD ]  }|j                  |«      }Œ |sŒ	 |j                  t        j                  |«      «       ŒD | j&                  t(        j*                  j,                  ur¥| j&                  |vr—t        | j&                  t/        d„ |D «       «      «      sqt1        j2                  t        «      5  t5        t7        t9        j:                  | j&                  «      «      dd«       |j=                  d| j&                  «       d d d «       |s|s�ŒŽ|rt9        j>                  |«      nt9        j@                  «       |r.t9        jB                  tE        t8        jF                  |«      Ž z  c S t9        j@                  «       z  c S  t        | j&                  tH        «      rt9        jJ                  «       S t        | j&                  tL        jN                  «      r(t9        j>                  t!        | j&                  «      «      S | j&                  t(        j*                  j,                  urt9        j:                  | j&                  «      S tQ        | j                   jS                  «       ¬«      S # t        t        f$ rI t        |«      }	t        |	t         «      st#        |	«      r|	€J ‚ |j                  t%        |	«      «       Y �ŒÃw xY w# 1 sw Y   �ŒÁxY w)Nz^\s*\:type\s+z	\:\s+(.+)z^\s*z
 \((.+)\):z \: (.+))ÚflagsrU   z
, optionalz}{z,? +or +| *, *)zdefault zpython c              3   óB   K  — | ]  }t        |t        «      sŒ|–— Œ y ­wr5   )rJ   rL   )Ú.0Úts     r8   ú	<genexpr>z _strategy_for.<locals>.<genexpr>!  s   è ø€ Ò$M¨1¼ÀAÄtÕ9L¤QÑ$Mùs   ‚˜ú<string>Úevalr   )r‘   )*r‘   rm   Úsearchro   ÚgroupÚremovesuffixÚstripÚsplitÚremoveprefixr\   ÚastÚliteral_evalÚ
ValueErrorÚSyntaxErrorrˆ   rJ   rL   r+   r–   ÚdefaultÚinspectÚ	ParameterÚemptyr@   r“   r”   rn   ÚreprÚstÚjustÚinsertÚsampled_fromÚnothingÚone_ofÚmapÚ	from_typeÚboolÚbooleansÚenumÚEnumÚ_guess_strategy_by_argnameÚlower)
r—   r˜   ÚpatternÚmatchÚdoc_typeÚelementsÚtypesrv   Úprefixr�   s
             r8   Ú_strategy_forrÄ   ý   s¾  € ð ˜Ÿ™˜ IÐ.Ø�—
‘
ˆ|˜:Ð&Ø�—
‘
ˆ|˜8Ð$ðó (ˆô
 —	‘	˜' 9´B·L±LÔAˆØˆ=ØØ—;‘;˜q“>ˆØ×(Ñ(¨Ó6×<Ñ<¸TÓBˆØˆØˆÜ—X‘XÐ/°Ó:ò 	5ˆEØ1ò 3�à×*Ñ*¨6Ó2‘ð3ñ Øð5à—‘¤× 0Ñ 0°Ó 7Ô8Øð	5ð  �M‰M¤×!2Ñ!2×!8Ñ!8Ñ8Ø—‘ XÑ-ÜØ—‘œuÑ$M°Ô$MÓMôô ×$Ñ$¤[Ó1ñ 2ÜœœRŸW™W U§]¡]Ó3Ó4°jÀ&ÔIØ—‘  5§=¡=Ô1÷2ñ “uÙ19”B—O‘O HÔ-¼r¿z¹z»|Ù8=”—	‘	œ3œrŸ|™|¨UÓ3Ð4ñò ÜCEÇ:Á:Ã<ñò ðM(ôX �%—-‘-¤Ô&Ü�{‰{‹}ÐÜ�%—-‘-¤§¡Ô+Ü�‰œt E§M¡MÓ2Ó3Ð3Ø‡}�}œG×-Ñ-×3Ñ3Ñ3ô �w‰w�u—}‘}Ó%Ð%Ü%¨5¯:©:×+;Ñ+;Ó+=Ô>Ð>øô? ¤Ð,ò 5Ü+¨EÓ2�Ü˜a¤Ô&¬/¸!Ô*<Ø˜=Ð(˜=Ø �E—L‘L¤°Ó!3Ô4úð	5ú÷2ñ 2ús    Ã$LÅ AM/ÌAM,Í+M,Í/M9	)ÚkeepdimsÚverboseÚdebugÚforceÚtrainÚtrainingÚ	trainableÚbiasÚshuffleÚshowÚloadÚ
pretrainedÚsaveÚ	overwriteÚ	normalizeÚreverseÚsuccessÚenabledÚstrictÚcopyÚquietÚrequiredÚinplaceÚ	recursiveÚenableÚactiveÚcreateÚvalidateÚrefreshÚuse_bias)ÚwidthÚsizeÚlengthÚlimitÚidxÚstrideÚepochÚepochsÚdepthÚpidÚstepsÚ	iterationÚ
iterationsÚ
vocab_sizeÚttlÚcount)ÚrealÚimagÚalphaÚthetaÚbetaÚsigmaÚgammaÚangleÚrewardÚtauÚtemperature)ÚtextÚtxtÚpasswordÚlabelrÃ   ÚsuffixÚdescÚdescriptionrl   r¾   ÚsubjectÚreasonÚcommentÚpromptÚsentenceÚsepr‘   c                 óF  — | dv rt        j                  «       S | dv r)t        j                  t        j                  «       d¬«      S | dv rOt        j                  t        j                  «       «      t        j                  t        j
                  «       «      z  S | dv r't        j                  t        j                  «       «      S | dv rt        j                  t        «      S d| v r't        j                  «       j                  t        «      S | j                  d	«      s| t        v rt        j                  «       S | d
v r)t        j                  «       t        j                  «       z  S | dv rt        j                  dd«      S | j!                  d«      s3| j!                  d«      rd| vst#        j$                  d| «      s| t&        v rt        j                  d¬«      S | dv rt        j                  «       S | dv rt        j                  dd«      S | dv rt        j                  dd«      S | dv rt        j                  dd«      S | dv rt        j                  d¬«      S | t(        v rt        j                  «       S | dv r
t+        «       S | dv rt        j,                  «       S | dv rt        j.                  d d¬!«      S | d"v rt        j0                  «       S d#| v sd$| v s| j!                  d%«      s| d&v rt        j                  «       S | j!                  d'«      s%| j!                  d(«      rd| vsd)| v rd*| vs| t2        v rt        j
                  «       S t#        j$                  d+| «      r/t5        | d,d- «      }|j6                  st        j                  |«      S t        j                  «       S ).a‚  
    If all else fails, we try guessing a strategy based on common argument names.

    We wouldn't do this in builds() where strict correctness is required, but for
    the ghostwriter we accept "good guesses" since the user would otherwise have
    to change the strategy anyway - from `nothing()` - if we refused to guess.

    A "good guess" is _usually correct_, and _a reasonable mistake_ if not.
    The logic below is therefore based on a manual reading of the builtins and
    some standard-library docs, plus the analysis of about three hundred million
    arguments in https://github.com/HypothesisWorks/hypothesis/issues/3311
    )ÚfunctionÚfuncÚf)ÚpredÚ	predicateT)ÚreturnsÚpure)Úiterable)r=   ÚlstÚls)ÚobjectÚuuidÚis_)ÚamountÚ	thresholdÚnumberÚnum)Úportr   iÿÿ  Ú_sizerä   Ú_zn(um)?_[a-z_]*s)Ú	min_value)ÚoffsetÚseedÚdimÚtotalÚpriority)Úlearning_rateÚdropoutÚdropout_rateÚepsilonÚepsÚprobrU   )ÚlatÚlatitudei¦ÿÿÿéZ   )ÚlonÚ	longitudeiLÿÿÿé´   )ÚradiusÚtolÚ	toleranceÚrate)ÚhostÚhostname)Úemail)ÚwordÚslugÚapi_keyz\w+)r…   )ÚcharÚ	characterÚfileÚpathÚ_dir)ÚfnamerZ   ÚdirnameÚ	directoryÚfolder)Ú_namer  r‘   ÚstringÚasz\w*[^s]sNr|   )r°   Ú	functionsr¹   Ú	iterablesÚintegersrþ   Úlistsr´   Úbuildsr  Úuuidsr¶   rl   Ú
startswithÚ
BOOL_NAMESÚfloatsr‰   rm   r…   ÚPOSITIVE_INTEGER_NAMESÚFLOAT_NAMESr   ÚemailsÚ
from_regexÚ
charactersÚSTRING_NAMESr¼   Úis_empty)r‘   r�   s     r8   r¼   r¼   P  sú  € ð Ð(Ñ(Ü�|‰|‹~ÐØÐ$Ñ$Ü�|‰|¤B§K¡K£M¸Ô=Ð=Øˆ}ÑÜ�|‰|œBŸK™K›MÓ*¬R¯\©\¼"¿'¹'»)Ó-DÑDÐDØÐ$Ñ$Ü�x‰xœŸ
™
›Ó%Ð%Øˆ{ÑÜ�y‰yœÓ Ð Ø��~Ü�x‰x‹z�~‰~œcÓ"Ð"ð ‡��uÔ ¬Ñ!3Ü�{‰{‹}Ðð Ð7Ñ7Ü�{‰{‹}œrŸy™y›{Ñ*Ð*àˆyÑÜ�{‰{˜1˜iÓ(Ð(à�‰�gÔØ�M‰M˜&Ô! c°¡oÜ�<‰<Ð*¨DÔ1ØÔ)Ñ)ä�{‰{ QÔ'Ð'ØÐ=Ñ=Ü�{‰{‹}ÐàÐUÑUÜ�y‰y˜˜A‹ÐØÐ"Ñ"Ü�y‰y˜˜bÓ!Ð!ØÐ#Ñ#Ü�y‰y˜˜sÓ#Ð#ØÐ5Ñ5Ü�y‰y 1Ô%Ð%ØŒ{ÑÜ�y‰y‹{Ðð Ð#Ñ#Ü‹yÐØˆzÑÜ�y‰y‹{ÐØÐ*Ñ*Ü�}‰}˜V¨tÔ4Ð4ØÐ$Ñ$Ü�}‰}‹Ðð 	�$‰Ø�T‰>Ø�=‰=˜Ô ØÐEÑEô �z‰z‹|Ðð 	�‰Ð(Ô)Ø�M‰M˜&Ô! c°¡oØ˜Ñ ¨TÑ!1Ø”<Ñä�w‰w‹yÐô 
‡|�|�K Ô&Ü*¨4°°¨9Ó5ˆØ�~Š~Ü—8‘8˜E“?Ð"ô �:‰:‹<Ðr:   r  c                 ó†  — t        | t        j                  t        j                  f«      �r•t	        | d«      �rˆt        | j
                  t        «      �rmt        j                  d| j                  › d�| j
                  «      }|€g S |j                  d«      j                  dd«      j                  dd«      }g }t        j                  j                  }|j                  d«      D ]Ø  }|j!                  d	«      ^}}|j#                  «       }|d
k(  rt        j                  j$                  }ŒF|j'                  d«      s|dk(  rt        j                  j(                  }Œwt+        |j-                  d«      «      s|j-                  d«      j/                  «       s |S |j1                  t        j                  ||¬«      «       ŒÚ |S g S )NÚ__doc__ú^z	\((.+?)\)rU   ú[rR   ú]rW   ú=ú/Ú*z...©r‘   Úkind)rJ   rÂ   ÚBuiltinFunctionTypeÚBuiltinMethodTypeÚhasattrrY  rl   rm   r¿   r6   r¢   Úreplacer¬   r­   ÚPOSITIONAL_ONLYr¥   Ú	partitionr¤   ÚPOSITIONAL_OR_KEYWORDrN  ÚKEYWORD_ONLYÚ
_iskeywordÚlstripÚisidentifierr\   )r  r¿   ÚargsÚparamsra  Úargr  s          r8   Ú_get_params_builtin_fnrp  ±  sk  € ä�4œ%×3Ñ3´U×5LÑ5LÐMÕNÜ�D˜)Õ$Ü�t—|‘|¤SÕ)ô —‘˜A˜dŸm™m˜_¨IÐ6¸¿¹ÓEˆØˆ=ØˆIØ�{‰{˜1‹~×%Ñ% c¨2Ó.×6Ñ6°s¸BÓ?ˆØˆô (/×'8Ñ'8×'HÑ'HˆØ—:‘:˜dÓ#ò 	BˆCØ—m‘m CÓ(ˆGˆC�!Ø—)‘)“+ˆCØ�cŠzÜ×(Ñ(×>Ñ>�ØØ�~‰~˜cÔ" c¨U¢lÜ×(Ñ(×5Ñ5�ØÜ˜#Ÿ*™* S›/Ô*°#·*±*¸S³/×2NÑ2NÔ2PØàˆð �M‰Mœ'×+Ñ+°¸4Ô@ÕAð	Bð ˆØ€Ir:   c                 óÂ   — t        | «      rNt        d | j                   D �cg c]1  }t        j                  |t        j                  j
                  ¬«      ‘Œ3 c}S g S c c}w )Nr`  )Ú_is_probably_ufuncr   Úninr¬   r­   rf  )r  r‘   s     r8   Ú_get_params_ufuncrt  Ñ  sW   € Ü˜$Ôô (¨
¨$¯(©(Ð3ö
àô ×Ñ 4¬g×.?Ñ.?×.OÑ.OÖPò
ð 	
ð €Iùò	
s   ¡6Ac                 óú  — 	 t        t        | «      j                  j                  «       «      }t        j
                  }d|j                  fd|j                  fg}t        | «      x}r|}t        |«      S |D �cg c]  }|j                  |j                  f‘Œ c}|k(  rt        | «      xs |}t        |«      S t        |«      S c c}w # t        $ r* t        | «      x}rnt        | «      x}rn‚ Y t        |«      S w xY w)z7Get non-vararg parameters of `func` as an ordered dict.rm  Úkwargs)r=   r   Ú
parametersÚvaluesr¬   r­   ÚVAR_POSITIONALÚVAR_KEYWORDrt  r‘   ra  rp  rM   Ú_params_to_dict)r  rn  ÚPÚplaceholderÚufunc_paramsÚps         r8   Ú_get_paramsr€  à  s  € ð<Ü”m DÓ)×4Ñ4×;Ñ;Ó=Ó>ˆô ×ÑˆØ × 0Ñ 0Ð1°H¸a¿m¹mÐ3LÐMˆÜ,¨TÓ2Ð2ˆ<Ð2ð "ˆFô ˜6Ó"Ð"ð )/Ö/ 1ˆq�v‰v�q—v‘vÒÒ/°;Ò>ä+¨DÓ1Ò;°VˆFÜ˜6Ó"Ð"Œ?˜6Ó"Ð"ùò 0øô) ò Ü& tÓ,Ð,ˆ6Ð,ð Ü-¨dÓ3Ð3ˆVÐ3Øð øô ˜6Ó"Ð"ð/ús   ‚,C Á8CÃ&C:Ã9C:rn  c                 ó”   ‡— t         j                  j                  t         j                  j                  fŠt	        ˆfd„| D «       «      S )Nc              3   óX   •K  — | ]!  }|j                   ‰vsŒ|j                  |f–— Œ# y ­wr5   )ra  r‘   )rœ   r  Úvar_param_kindss     €r8   rž   z"_params_to_dict.<locals>.<genexpr>  s$   øè ø€ ÒT q°a·f±fÀOÒ6S˜Ÿ™ ”{ÑTùs   ƒ*—*)r¬   r­   ry  rz  r   )rn  rƒ  s    @r8   r{  r{  þ  s8   ø€ ô ×(Ñ(×7Ñ7¼×9JÑ9J×9VÑ9VÐW€OÜÓT¨FÔTÓTÐTr:   c               #   ó.  K  — t         t        v rd –— y 	 t        j                  t        «      t        t         <   d –— t        t         = t        j
                  j                  «        y # t        t         = t        j
                  j                  «        w xY w­wr5   )r   r*   r°   rL  r  r·   Ú__clear_cache© r:   r8   Ú_with_any_registeredr‡    sc   è ø€ ô Ô!Ñ!Üð	)Ü')§y¡y´Ó'8Ô¤Ñ$Ûä#¤CÐ(Ü�L‰L×&Ñ&Õ(øô $¤CÐ(Ü�L‰L×&Ñ&Õ(üs   ‚B•(A' ½*BÁ'+BÂBF)Úpass_result_to_next_funcÚfuncsrˆ  c           
      ód  — |sJ d«       ‚i }t        |«      D �]3  \  }}t        |«      }| r|dk\  r|t        t        |«      «      = t	        |«      }t        |dd«      xs d}|j                  «       D ��	ci c]  \  }}	|||v rdnt        |	|«      “Œ }
}}	t        «       5  t        j                  |fi |
¤Žj                  }ddd«       j                  rt        d«      ‚|j                  j                  «       D ]P  \  }}	t        |	«      d   dk(  r#||v rt!        t        j"                  ||   fi «      }	||v r||xx   |	z  cc<   ŒL|	||<   ŒR �Œ6 t%        |«      dk(  rt        «      D �ci c]  }|||   “Œ
 c}S t'        t)        |j                  «       «      «      S c c}	}w # 1 sw Y   ŒãxY wc c}w )	aL  Return a dict of strategies for the union of arguments to `funcs`.

    If `pass_result_to_next_func` is True, assume that the result of each function
    is passed to the next, and therefore skip the first argument of all but the
    first function.

    This dict is used to construct our call to the `@given(...)` decorator.
    zMust pass at least one functionrU   rY  NrR   .z%Expected to pass everything as kwargsú	nothing())rK   r€  ÚnextÚiterr   rq   ÚitemsrÄ   r‡  r°   rL  Úwrapped_strategyrm  ÚNotImplementedErrorrv  Ú_valid_syntax_reprr$   r·   r_   ÚdictrA   )rˆ  r‰  Úgiven_strategiesrO   r  rn  Úhintsr˜   ÚkÚvÚbuilder_argsÚstratr‘   s                r8   Ú_get_strategiesr™    sÁ  € ñ Ð3Ð3Ó3ˆ5Ø57ÐÜ˜%Ó ó (‰ˆˆ1Ü˜Q“ˆÙ#¨¨QªØ”tœD ›LÓ)Ð*Ü˜qÓ!ˆÜ˜A˜y¨$Ó/Ò5°2ˆ	ð Ÿ™›÷
á��1ð �a˜5‘j‰s¤m°A°yÓ&AÑAð
ˆñ 
ô "Ó#ñ 	BÜ—I‘I˜aÑ0 <Ñ0×AÑAˆE÷	Bð �:Š:Ü%Ð&MÓNÐNà—L‘L×&Ñ&Ó(ò 	(‰DˆAˆqÜ! !Ó$ QÑ'¨;Ò6¸1À¹:ä ¤§¡°°a±¨{¸BÓ?�ØÐ$Ñ$Ø  Ó# qÑ(Ô#à&'Ð  Ò#ò	(ð!(ô6 ˆ5ƒz�Q‚Ü9DÀQ»ÖH°�Ð& tÑ,Ñ,ÒHÐHÜ”Ð'×-Ñ-Ó/Ó0Ó1Ð1ùó/
÷	Bð 	Büò$ Is   Á4FÂ!F!Å)F-Æ!F*	rC   rD   c           	      óš   — | dk(  r	d|› d|› d�S | dk(  sJ ‚|j                  «       r|j                  «       rd|› d|› d|› d|› d�	S d|› d|› �S )	Nrh   zself.assertEqual(rW   rI   rg   zassert z == z, ()rl  )re   rC   rD   s      r8   Ú
_assert_eqr›  E  st   € Ø�
ÒØ" 1 # R¨ s¨!Ð,Ð,Ø�HÒÐÐØ‡~�~Ô˜AŸN™NÔ,Ø˜˜˜4 ˜s # a S¨¨1¨#¨QÐ/Ð/Ø�Q�C�t˜A˜3ÐÐr:   c                 óâ  — t        | «      t        t        dt        «       «      u rB t	        «       j
                  t        t        | j                  «      Ž D ��ch c]  \  }}|’Œ	 c}}S t        | t        j                  t        j                  f«      rdhS t        | t        j                  «      rt        | «      S t        | t        t         j"                  j%                  d«      dd«      «      rdhS 	 t'        | «      r{t        | t(        «      r| j*                  | j,                  fhS t/        j0                  t2        «      5   t	        «       j
                  t        t        | j                  «      Ž cddd«       S t5        | «      r| j,                  dk(  r
t	        «       S t7        | «      j9                  d	«      d
   }t;        | «      |fhS c c}}w # 1 sw Y   Œ^xY w# t2        $ r t	        «       cY S w xY w)zAReturn the imports for `obj`, which may be empty for e.g. lambdasÚ	UnionTyperm   ry   rz   r†  )ry   rz   Nz<lambda>r   r   )rL   rq   rÂ   r  rX   Úunionr¶   Ú_imports_for_objectÚ__args__rJ   rm   ÚPatternÚMatchr°   ÚSearchStrategyÚ_imports_for_strategyrƒ   r„   r‹   r+   r   r^   r6   r“   r”   rM   ÚcallablerN   r¥   Ú_get_module)Úobjr�   r  r‘   s       r8   rŸ  rŸ  N  s„  € äˆCƒy”GœE ;´³Ó9Ñ9Ø"-¤#£%§+¡+¬sÔ3FÈÏÉÓ/UÐ"V×W™˜˜Q’ÓWÐWÜ�#œŸ
™
¤B§H¡HÐ-Ô.ØˆvˆÜ�#”r×(Ñ(Ô)Ü$ SÓ)Ð)Ü�#”wœsŸ{™{Ÿ™¨wÓ7¸À"ÓEÔFØ"Ð#Ð#ðÜ˜3ÔÜ˜#œwÔ'ð Ÿ™¨¯©Ð6Ð7Ð7Ü×$Ñ$¤YÓ/ñ LØ"”s“u—{‘{¤CÔ(;¸S¿\¹\Ó$JÐK÷Lñ Lä˜” #§,¡,°*Ò"<Ü“5ˆLÜ˜SÓ!×'Ñ'¨Ó,¨QÑ/ˆÜ˜SÓ! 4Ð(Ð)Ð)ùó' X÷Lð Lûô ò Ü‹uŠðúsB   ÁGÃ13G Ä%G Ä>/GÅ-	G Å7#G Æ*G ÇGÇG ÇG.Ç-G.c           	      ó4  — t        | t        «      rçt        | j                  «      t        | j                  j                  «       «      z  D ��ch c]  }t        t        |«      «      D ]  }|’Œ Œ }}}t        j                  dt        | «      «      r|S t        | j                  «      j                  d«      rAt        | j                  «      j                  dd«      }|| j                  j                  fh|z  S t        «       }t!        j"                  «       5  t!        j$                  dt&        «       t)        | «      } d d d «       t        | t*        «      r0|t-        | j.                  «      z  }|t        | j0                  «      z  }t        | t2        «      r7|t-        | j4                  «      z  }| j6                  D ]  }|t        |«      z  }Œ t        | t8        «      r0|t-        | j:                  «      z  }|t        | j<                  «      z  }t        | t>        «      r| j@                  D ]  }|t-        |«      z  }Œ t        | tB        «      rd|t        | jD                  «      z  }| jF                  D ]  }|t-        |«      z  }Œ | jH                  j                  «       D ]  }|t-        |«      z  }Œ t        | tJ        «      r| jL                  D ]  }|t        |«      z  }Œ t        | tN        «      r|t-        | jP                  «      z  }|S c c}}w # 1 sw Y   �ŒÓxY w)Nzfrom_(type|regex)\(zhypothesis.extra.z._array_helpersz.numpyÚignore))rJ   r$   rX   Ú_LazyStrategy__argsÚ_LazyStrategy__kwargsrx  rŸ  r–   rm   r¿   r¯   r¦  r  rN  re  r6   ÚwarningsÚcatch_warningsÚsimplefilterr   r%   r'   r¤  Úmapped_strategyÚpackr&   Úfiltered_strategyÚflat_conditionsr#   ÚbaseÚexpandr(   Úelement_strategiesr!   Útargetrm  rv  r)   rÁ   r    Úelement_strategy)Ústrategyro  Úimprb   Úmoduler  r{   r§  s           r8   r¤  r¤  i  sÔ  € ô �(œLÔ)ô ˜8×7Ñ7Ó8Ü�(×0Ñ0×7Ñ7Ó9Ó:ñ;÷
àä*¬?¸3Ó+?Ó@ò	
ð ò ð
Øð
ˆñ 
ô �8‰8Ð*¬D°«NÔ;ØˆNÜ˜×*Ñ*Ó+×6Ñ6Ð7JÔKÜ  ×!2Ñ!2Ó3×;Ñ;Ð<MÈxÓXˆFØ˜X×.Ñ.×7Ñ7Ð8Ð9¸GÑCÐCä‹e€GÜ	×	 Ñ	 Ó	"ñ /Ü×Ñ˜hÔ(?Ô@Ü$ XÓ.ˆ÷/ô
 �(œNÔ+ØÔ(¨×)AÑ)AÓBÑBˆØÔ& x§}¡}Ó5Ñ5ˆÜ�(Ô,Ô-ØÔ(¨×)CÑ)CÓDÑDˆØ×)Ñ)ò 	.ˆAØÔ*¨1Ó-Ñ-‰Gð	.ä�(œOÔ,ØÔ(¨¯©Ó7Ñ7ˆØÔ& x§¡Ó7Ñ7ˆô �(œMÔ*Ø×,Ñ,ò 	0ˆAØÔ,¨QÓ/Ñ/‰Gð	0ô �(œNÔ+ØÔ& x§¡Ó7Ñ7ˆØ—‘ò 	0ˆAØÔ,¨QÓ/Ñ/‰Gð	0à—‘×'Ñ'Ó)ò 	0ˆAØÔ,¨QÓ/Ñ/‰Gð	0ô �(Ô/Ô0Ø×$Ñ$ò 	0ˆCØÔ*¨3Ó/Ñ/‰Gð	0ô �(œLÔ)ØÔ(¨×)BÑ)BÓCÑCˆà€Nùóc
÷/ñ /ús   Á"LÄ&LÌLc                 óV  — t        | t        «      rt        «       | fS 	 t        | t        «      r| j                  } t        | t
        «      rót        «       }g }t        j                  «       5  t        j                  dt        «       | j                   d d d «       | j                  D ]j  }t        |t        «      r|j                  t        j                  fk(  rŒ2t        |«      |vsŒ@|j!                  |«       |j#                  t        |«      «       Œl t%        j&                  |xs t%        j(                  «       «      } | t%        j*                  «       j                  k(  rt        «       dfS | t%        j,                  t.        «      k(  rt        «       dfS t        | t0        «      r^| j2                  j4                  t$        j,                  j4                  k(  r-| j6                  €!t9        d„ | j:                  D «       «      | _        t        | «      j=                  dd«      j=                  dd«      }t?        j@                  dd	|«      }tC        |d
d«       tE        | «      D �ch c]  }|d   |v sŒ|’Œ }}||fS # 1 sw Y   �ŒäxY wc c}w # tF        tH        tJ        f$ r t        «       dfcY S w xY w)Nr©  ztext()zfrom_type(type)c              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr5   )r–   )rœ   rC   s     r8   rž   z%_valid_syntax_repr.<locals>.<genexpr>Â  s   è ø€ ò 1Ø'(” ×"ñ1ùó   ‚z.filter(_can_hash)rR   úhypothesis.strategies.z(lambda.*?: )(<unknown>)([,)])z\1...\3rŸ   r    rU   r‹  )&rJ   rl   rX   r"   r�  r(   r¬  r­  r®  r   rµ  r)   rÁ   ÚosÚenvironr¯   r\   r]   r°   rµ   r´   rþ   r·   rL   r$   r  r6   Ú_LazyStrategy__representationr@   rª  re  rm   Úsubrn   r¤  rª   ÚRecursionErrorr   )r¸  Úseenr�   r{   ÚrrO   rb   s          r8   r‘  r‘  ¡  s2  € ä�(œCÔ Ü‹u�hˆÐð."Ü�hÔ 0Ô1Ø×0Ñ0ˆHÜ�h¤Ô.Ü“5ˆDØˆEÜ×(Ñ(Ó*ñ ,Ü×%Ñ% hÔ0GÔHØ×+Ò+÷,ð ×0Ñ0ò &�Ü˜aÔ!4Ô5¸!¿*¹*ÌÏÉÈÒ:UØÜ˜“7 $Ò&Ø—L‘L ”OØ—H‘HœT !›WÕ%ð&ô —y‘y Ò!6¬"¯*©*«,Ó7ˆHà”r—w‘w“y×1Ñ1Ò1Ü“5˜(�?Ð"Ø”r—|‘|¤DÓ)Ò)Ü“5Ð+Ð+Ð+ô �x¤Ô.Ø×!Ñ!×*Ñ*¬b¯l©l×.CÑ.CÒCØ×6Ñ6Ð>ä+0ñ 1Ø,4×,HÑ,Hô1ó ,ˆHÔ(ô �‹Nß‰WÐ)¨2Ó.ß‰WÐ-¨rÓ2ð 	
ô �F‰FÐ4°jÀ!ÓDˆÜ��:˜vÔ&ô 4°HÓ=ÖK˜ÀÀ1ÁÈÂ’1ÐKˆÐKØ˜ˆzÐ÷M,ñ ,üòJ Løäœ¬Ð9ò "Ü‹u�kÐ!Ò!ð"úsQ   žAJ Á*'I3ÂAJ Ã%BJ Å*'J ÆC
J ÉJ É)J É-J É3I=É8J Ê J(Ê'J(ÚKNOWN_FUNCTION_LOCATIONSc                 ó\  — | j                   }|dk(  r|S t        |«      D ��cg c]  \  }}|dk(  sŒ|‘Œ c}}d gz   }|D ]e  }|d | j                  d«      |d | fD ]G  }t        t        j
                  j                  |«      | j                  d «      | u sŒ:|t        | <   |c c S  Œg |S c c}}w )Nzcollections.abcr   r  )	r^   rK   rk  rq   rƒ   r„   r‹   r6   rÆ  )r§  Úmodule_namerO   ÚcÚdotsrç   Ú	candidates          r8   Ú_get_module_helperrÌ  Ý  sÀ   € ð
 —.‘.€Kð Ð'Ò'ØÐä# KÓ0×=‘$�!�Q°A¸³HŠAÓ=ÀÀÑF€DØò !ˆØ% d sÐ+×2Ñ2°3Ó7¸ÀTÀcÐ9JÐKò 	!ˆIÜ”s—{‘{—‘ yÓ1°3·<±<ÀÓFÈ#ÒMØ09Ô(¨Ñ-Ø Ô ñ	!ð!ð
 Ðùó >s
   ¢B(°B(c                 óZ  — | t         v r	t         |    S 	 t        | «      S # t        $ rƒ t        | «      s‚ t	        t
        j                  d„ ¬«      D ];  }| t        t
        j                  |   | j                  d «      u sŒ.|t         | <   |c cY S  t        d| j                  › d| ›�«      d ‚w xY w)Nc                 ó6   — t        | j                  d«      «      S )Nr   )r@   r¥   )Úns    r8   r9   z_get_module.<locals>.<lambda>ù  s   € ¼UÀ1Ç7Á7È3Ã<Ó=P€ r:   r;   z Could not find module for ufunc z ()
rÆ  rÌ  ÚAttributeErrorrr  rA   rƒ   r„   rq   r6   ÚRuntimeError)r§  rÈ  s     r8   r¦  r¦  ñ  s°   € Ø
Ô&Ñ&Ü'¨Ñ,Ð,ðÜ! #Ó&Ð&øÜò 	Ü! #Ô&ØÜ!¤#§+¡+Ñ3PÔQò 	#ˆKØ”gœcŸk™k¨+Ñ6¸¿¹ÀdÓKÒKØ0;Ô(¨Ñ-Ø"Ô"ð	#ô Ø.¨s¯|©|¨n¸B¸s¸gÐFó
àð	ð	ús   “
 žAB*Á=B*ÂB*rS   r§  rT   c                ó¾   — t        | d| j                  «      }|j                  dd«      j                  dd«      j                  dd«      }|rt        | «      dz   |z   S |S )NrY   ú<r  ú>ú rR   r   )rq   r6   re  r¦  )r§  rT   Úqnames      r8   rN   rN     s[   € ä�C˜¨¯©Ó6€EØ�M‰M˜#˜sÓ#×+Ñ+¨C°Ó5×=Ñ=¸cÀ2ÓF€EÙÜ˜3Ó #Ñ%¨Ñ-Ð-Ø€Lr:   rR   )rF   ÚassignÚpass_variablesr×  c          	      óÜ  — dj                  d„ t        |t        | «      j                  «       «      D «       «      }t	        | d¬«      › d|› d�}|r|› d|› �}t        t        | dd	«      xs d	«      }|D �cg c]  }t        ||«      rŒ|j                  ‘Œ }}|s|S t        j                  t        |d
¬«      t        |«      dkD  rddj                  |«      z   dz   ¬«      S |d   ¬«      S c c}w )aÍ  Write a call to `func` with explicit and implicit arguments.

    >>> _write_call(sorted, "my_seq", "func")
    "builtins.sorted(my_seq, key=func, reverse=reverse)"

    >>> write_call(f, assign="var1")
    "var1 = f()"

    The fancy part is that we'll check the docstring for any known exceptions
    which `func` might raise, and catch-and-reject on them... *unless* they're
    subtypes of `except_`, which will be handled in an outer try-except block.
    rW   c              3   óÌ   K  — | ]\  \  }}|j                   t        j                  j                  u r|xs+ |j                  n|j                  › d |xs |j                  › �–— Œ^ y­w©r]  N)ra  r¬   r­   rf  r‘   )rœ   r–  r  s      r8   rž   z_write_call.<locals>.<genexpr>  s_   è ø€ ò ñ ˆAˆqð �v‰vœ×*Ñ*×:Ñ:Ñ:ð Š[�!—&’&à—F‘F�8˜1˜Qš[ !§&¡&˜MÐ*ó+ñùs   ‚A"A$TrS   rV   rI   ú = rY  rR   ú    ©rÃ   rU   r   ©Ú	test_bodyra   )r`   r	   r€  rx  rN   ru   rq   r>   r6   ÚSUPPRESS_BLOCKÚformatr   r_   )	r  rF   r×  rØ  rm  Úcallrr   rc   Úexnamess	            r8   Ú_write_callrå    s  € ð �9‰9ñ ô   ´¸DÓ0A×0HÑ0HÓ0JÓKôó €Dô ˜D°Ô6Ð7°q¸¸¸aÐ@€DÙØ�˜˜T˜FÐ#ˆÜ'¬°°iÀÓ(DÒ(JÈÓK€FØ%+ÖK˜r´:¸bÀ'Õ3Jˆr�{‹{ÐK€GÐKÙØˆÜ× Ñ Ü˜ fÔ-Ü58¸³\ÀAÒ5E�3˜Ÿ™ 7Ó+Ñ+¨cÑ1ð !ó ð àKRÐSTÉ:ð !ó ð ùò Ls   Á4C)ÂC)r{   c                 ó˜   — dj                  t        t        j                  t        d¬«      «      }t        j                  d|› d�d| ¬«      S )z…Replace strategy name() with st.name().

    Uses a tricky re.sub() to avoid problems with frozensets() matching
    sets() too.
    ú|T)r<   rÔ   z\b(?:z)\b[^= ]zst.\g<0>)r¾   ÚreplrF  )r`   rA   r°   Ú__all__r_   rm   rÂ  )r{   Únamess     r8   Ú_st_strategy_namesrë  /  s;   € ð �H‰H”VœBŸJ™J¬C¸Ô>Ó?€EÜ�6‰6˜U 5 '¨Ð2¸ÈQÔOÐOr:   )Ú
assertionsr“  rb   Úghostrà  rì  r“  rb   Úannotatec                 óL  — |xs
 t        «       |D �	ch c]  }	t        |	«      ’Œ c}	z  }t        «       5  |xs t        |d| dv iŽ}|s'dj	                  d„ |D «       «      }
t        d|
› d�«      ‚|j                  «       D ��cg c]  \  }}|gt        |«      ¢­‘Œ }}} |j                  d„ |D «       Ž }dj	                  d„ |D «       «      }d d d «       t        «      }|rAt        |«      \  }}|j                  |«       t        j                  t        |d	¬
«      |¬«      }|r|› d|› �}|dk(  rdgng }|r|j                  t!        |||«      «       n|j                  |«       t"        j                  || dj	                  d„ |D «       «      dj	                  |«      |rdndt        |d	¬
«      ¬«      }|dk(  rR|j%                  d«       dj                  | j'                  «       dj	                  d„ |D «       «      t        |d	«      «      }||fS c c}	w c c}}w # 1 sw Y   �ŒPxY w)Nrˆ  )Ú
idempotentÚ	roundtriprW   c              3   ó6   K  — | ]  }t        |d ¬«      –— Œ y­w)TrS   N)rN   ©rœ   r  s     r8   rž   z"_make_test_body.<locals>.<genexpr>O  s   è ø€ ÒSÈœm¨A¸d×CÐCÑSùs   ‚z&Can't write a property-based test for z-, because there are no arguments to generate.c              3   ó(   K  — | ]
  \  }}}|–— Œ y ­wr5   r†  )rœ   r  r¹  s      r8   rž   z"_make_test_body.<locals>.<genexpr>U  s   è ø€ Ò!=©)¨!¨S°!¤#Ñ!=ùs   ‚c              3   ó2   K  — | ]  \  }}}|› d |› �–— Œ y­wrÛ  r†  )rœ   r•  r  r–  s       r8   rž   z"_make_test_body.<locals>.<genexpr>V  s    è ø€ Ò?©g¨a°°A !  A a SœzÑ?ùr½  rÝ  rÞ  rß  ú
rh   Úselfr  c              3   óR   K  — | ]  }t        |«      j                  d d«      –— Œ! y­w)r   r  N)rN   re  ró  s     r8   rž   z"_make_test_body.<locals>.<genexpr>q  s"   è ø€ ÒMÀ!œ=¨Ó+×3Ñ3°C¸×=ÑMùs   ‚%'z -> NonerR   )Ú
given_argsÚ	test_kindÚ	func_nameÚ	arg_namesÚreturn_annotationrà  z%class Test{}{}(unittest.TestCase):
{}c              3   ón   K  — | ]-  }t        |«      j                  d d«      j                  «       –— Œ/ y­w)r   rR   N)rN   re  Útitleró  s     r8   rž   z"_make_test_body.<locals>.<genexpr>|  s+   è ø€ ÒMÀ!”M !Ó$×,Ñ,¨S°"Ó5×;Ñ;×=ÑMùs   ‚35)rX   r¦  r‡  r™  r`   r   rŽ  r‘  rž  rë  rd   Úupdaterá  râ  r   ÚextendÚ_annotate_argsÚTEMPLATEr]   rÿ  )rí  rà  rF   rì  re   r“  rb   rî  r‰  r  rê  r•  r–  Úreprsrù  r¹  Ú
exc_stringÚargnamesÚbodys                      r8   Ú_make_test_bodyr  9  sA  € ð Òœ#›%¸EÖ#B°q¤K°¥NÒ#BÑB€Gô 
Ó	ñ @Ø+ò 
¬Øð0
Ø-2Ð6QÐ-Qñ0
Ðñ  Ø—I‘IÑSÈUÔSÓSˆEÜ!Ø8¸¸ð @>ð >óð ð <L×;QÑ;QÓ;S×T±4°1°a�1Ð-Ô)¨!Ó,Ó-ÐTˆÑTØ�'—-‘-Ñ!=°uÔ!=Ð>ˆØ—Y‘YÑ?¸Ô?Ó?ˆ
÷@ô $ JÓ/€Jáä+¨GÓ4‰ˆˆZØ�‰�sÔô #×)Ñ)Ü˜Y¨vÔ6Ø!ð *ó 
ˆ	ñ
 Ø �k  J <Ð0ˆ	ð ! JÒ.�‰x°B€HÙØ�‰œÐ'7¸ÀÓHÕIà�‰Ð(Ô)ä�?‰?ØØØ—(‘(ÑMÀuÔMÓMØ—)‘)˜HÓ%Ù(0™*°bÜ˜¨6Ô2ð ó €Dð �
ÒØ�‰�JÔØ7×>Ñ>Ø�K‰K‹MØ�G‰GÑMÀuÔMÓMÜ�4˜Ó ó
ˆð �Dˆ=Ðùòs $Cùó U÷@ñ @ús#   ’H³AHÂHÂ1HÈHÈH#r  c              #   óê  K  — t        t        «      }|D ]˜  }	 t        t        |d¬«      j                  j                  «       «      }t        |«      j                  «       D ]K  \  }}|j                  t        j                  j                  k7  sŒ.||   j                  |j                  «       ŒM Œš | D ]/  }|j                  |«      }	t        |	|«      }
|
€|–— Œ'|› d|
› �–— Œ1 y # t        $ r Y ŒÛw xY w­w)NT)Úeval_strz: )r   rX   r@   r   rw  rx  r{  rŽ  Ú
annotationr¬   r­   r®   r]   rM   r‹   Ú_parameters_to_annotation_name)r  r‰  rb   Úarg_parametersr  rn  r<   r—   Úargnamerw  r  s              r8   r  r  ƒ  sø   è ø€ ô 2=¼SÓ1A€NØò 	>ˆð	>Üœ=¨¸Ô=×HÑH×OÑOÓQÓRˆFô
 .¨fÓ5×;Ñ;Ó=ò >‘
��UØ×#Ñ#¤w×'8Ñ'8×'>Ñ'>Ó>Ø" 3Ñ'×+Ñ+¨E×,<Ñ,<Õ=ñ>ð	>ð ò -ˆØ#×'Ñ'¨Ó0ˆ
Ü3°JÀÓHˆ
ØÐØ‹Mà�I˜R 
˜|Ð,Ó,ñ-øô ò 	áð	üs0   ‚C3˜.C$ÁAC3ÂAC3Ã$	C0Ã-C3Ã/C0Ã0C3c                   ó(   — e Zd ZU eed<   ee   ed<   y)Ú_AnnotationDataÚ	type_namerb   N)r6   r^   rY   rl   Ú__annotations__rX   r†  r:   r8   r  r  ›  s   … ØƒNØ�‰XÔr:   r  rw  c                 ó  — | €y t        d„ t        t        | «      D «       «      }|sy t        |«      dk(  r|d   \  }}|j	                  |«       |S t        ddhf|«      }|€J ‚|j	                  |j                  «       |j                  S )Nc              3   ó$   K  — | ]  }|�|–— Œ
 y ­wr5   r†  ©rœ   r  s     r8   rž   z1_parameters_to_annotation_name.<locals>.<genexpr>¥  s   è ø€ ò àØÐ!ô 	ñùs   ‚rU   r   útyping.UnionÚtyping)r@   r¶   Ú_parameter_to_annotationr_   r   Ú_join_genericsrb   r  )rw  rb   Úannotationsr  Únew_importsÚjoineds         r8   r  r     sœ   € ð ÐØÜñ äÔ6¸
ÓCôó €Kñ
 ØÜ
ˆ;Ó˜1ÒØ!,¨Q¡Ñˆ	�;Ø�‰�{Ô#ØÐÜ˜^¨h¨ZÐ8¸+ÓF€FØÐÐÐØ‡N�N�6—>‘>Ô"Ø×ÑÐr:   Úorigin_type_datar  c                 óà   — | €y | �| d   dk(  r	d„ |D «       }| \  }}t        |«      }|�|d   sy |\  }}|j                  |«       t        dj                  |dj	                  |«      «      |«      S )Nr   ztyping.Optionalc              3   óB   K  — | ]  }|�|j                   dk7  r|–— Œ y ­w)NÚNone)r  r  s     r8   rž   z!_join_generics.<locals>.<genexpr>À  s+   è ø€ ò 
àØÐ! Z×%9Ñ%9¸VÒ%Cô ñ
ùs   ‚z{}[{}]rW   )Ú_join_argument_annotationsr   r  râ  r`   )r  r  Úorigin_typerb   r  Ú	arg_typesr  s          r8   r  r  ¶  s�   € ð ÐØð Ð#Ð(8¸Ñ(;Ð?PÒ(Pñ
à)ô
ˆð ,Ñ€K�Ü'¨Ó4€FØ€~˜V AšYØà#Ñ€Iˆ{Ø‡N�N�;ÔÜ˜8Ÿ?™?¨;¸¿	¹	À)Ó8LÓMÈwÓWÐWr:   c                 ó¤   — t        «       }g }| D ]<  }|€ y |j                  |j                  «       |j                  |j                  «       Œ> ||fS r5   )rX   r\   r  r   rb   )r  rb   r#  r  s       r8   r!  r!  Ð  s[   € ô ›€GØ€Ià!ò +ˆ
ØÐÙØ×Ñ˜×-Ñ-Ô.Ø�‰�z×)Ñ)Õ*ð	+ð �gÐÐr:   Ú	parameterc           	      ó  — t        | t        «      ry t        | t        «      rLt        j                  d d dk  r| j
                  }|€y 	 | j                  «       }t        |«      S t        |«      S t        | t        «      rDt        d„ | D «       «      }|€y |\  }}t        dj                  dj                  |«      «      |«      S t        | t        «      rj| j                  dk(  r<t        | j                   dk(  rdt#        «       «      S | j                   t#        «       «      S t%        | d	¬
«      }|dk(  r>t        ddh«      S t'        | d«      rt'        | d«      rt%        | d	¬
«      }nt        | «      }|j)                  d«      r$t        |j+                  dd«      t#        «       «      S t-        | «      }|�|| k(  r)t        |t#        |j/                  dd¬«      d d «      «      S t1        | «      }|D �ch c]  }t        |«      ’Œ c}t2        hk(  rd}|j)                  d«      r#	 |d |j5                  d«       }	t        |	dh«      }
nt        |«      }
|rt9        |
d„ |D «       «      S |
S # t        $ r Y y w xY wc c}w # t6        $ r |}	Y ŒQw xY w)Nr3   )é   é   c              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr5   ©r  ©rœ   r—   s     r8   rž   z+_parameter_to_annotation.<locals>.<genexpr>ù  s   è ø€ ò ,
Ø05Ô$ U×+ñ,
ùr½  z[{}]rW   r[   ÚNoneTyper   TrS   ztypes.UnionTyper  r  r^   r6   r¾  úhypothesis.strategiesr°   r   rU   r€   r|   r†  ztyping.r[  c              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr5   r*  )rœ   Úarg_types     r8   rž   z+_parameter_to_annotation.<locals>.<genexpr>1  s   è ø€ ÒJ°HÔ% h×/ÑJùr½  )rJ   rl   r   rƒ   Úversion_infoÚ__forward_value__ÚevaluaterM   r  r=   r!  r  râ  r`   rL   r^   r6   rX   rN   rd  rN  re  r   rŠ   r   r   Úindexr©   r  )r%  Úforwarded_valuer  Úarg_type_namesr  r  r"  r#  rC   Únew_type_nameÚorigin_annotations              r8   r  r  ß  s›  € ä�)œSÔ!Øä�)œZÔ(Ü×Ñ˜B˜QÐ 'Ò)Ø'×9Ñ9ˆOØÐ&ØðØ"+×"4Ñ"4Ó"6�ô (¨Ó8Ð8Ô'¨Ó8Ð8ô �)œTÔ"Ü+ñ ,
Ø9Bô,
ó 
ˆð ˆ>ØØ&,Ñ#ˆ˜Ü˜vŸ}™}¨T¯Y©Y°~Ó-FÓGÈÓUÐUä�)œTÔ"Ø×Ñ :Ò-Ü"Ø#×,Ñ,°
Ò:�Ü“óð Ø@I×@RÑ@RÜ“óð ô
 " )¸DÔAˆ	ð Ð)Ò)ô # >°H°:Ó>Ð>ä�9˜lÔ+´¸	À:Ô0NÜ% iÀÔE‰Iä˜I›ˆIà×ÑÐ4Ô5Ü˜y×0Ñ0Ð1HÈ$ÓOÔQTÓQVÓWÐWä˜YÓ'€Kð Ð˜k¨YÒ6Ü˜y¬#¨i×.>Ñ.>¸sÈQÐ.>Ó.OÐPSÐQSÐ.TÓ*UÓVÐVä˜Ó#€IØ"Ö#�AŒˆQ�Ò#¬ yÒ0Øˆ	ð ×Ñ˜IÔ&ð	&Ø%Ð&<¨	¯©¸Ó(<Ð=ˆMô ,¨M¸H¸:ÓFÑä4°[ÓAÐáÜØÙJÀ	ÔJó
ð 	
ð ÐøôA ò ÙðüòZ $øô ò 	&Ø%ŠMð	&ús*   ÁI! Ç,I0ÈI5 É!	I-É,I-É5JÊJrH  c                  ó    — | D ]:  }	 t        |«      j                  j                  «       }t        d„ |D «       «      sŒ: y y# t        $ r Y ŒIw xY w)Nc              3   ój   K  — | ]+  }|j                   t        j                  j                  k7  –— Œ- y ­wr5   )r  r¬   r­   r®   r+  s     r8   rž   z(_are_annotations_used.<locals>.<genexpr>=  s'   è ø€ ÒSÀ5�5×#Ñ#¤w×'8Ñ'8×'>Ñ'>Õ>ÑSùs   ‚13TF)r   rw  rx  ÚanyrM   )rH  r  rn  s      r8   Ú_are_annotations_usedr;  6  s[   € Øò ˆð	Ü" 8Ó,×7Ñ7×>Ñ>Ó@ˆFô ÑSÈFÔSÕSÙðð øô ò 	Ùð	ús   ‡#AÁ	AÁAr  c                 ó¦  — |j                  dd«      j                  dd«      }| ddhz  } d|v r| j                  d«       h d£}| |z
  D �ch c]  }t        |t        «      sŒd	|› �’Œ }}t	        t
        «      }| D �ch c]  }t        |t        «      sŒ|’Œ c}D ]=  \  }}|j                  d
«      r|t        j                  v rŒ*||   j                  |«       Œ? |j                  «       D ��ch c]C  \  }}t        |t        «      r.||vr*dj                  |dj                  t        |«      «      «      ’ŒE }	}}t        j                  dj                  t        |«      t        |	«      z   «      ¬«      }
|j                  d«      }|dk(  r|
dz  }
n
|dk\  r|
dz  }
t!        j"                  |
|z   t!        j$                  «       ¬«      S c c}w c c}w c c}}w )Nz	builtins.rR   z	__main__.)Ú
hypothesisÚgiven)r=  zstrategies as stz        reject()
)r=  Úreject>   Ú__main__r[   r-  zimport r-  zfrom {} import {}rW   rö  )rb   zst.nothing()rU   z;# TODO: replace st.nothing() with an appropriate strategy

z:# TODO: replace st.nothing() with appropriate strategies

)Úmode)re  r]   rJ   rl   r   rX   r@   rN  r°   ré  rŽ  râ  r`   rA   ÚIMPORT_SECTIONrò   ÚblackÚ
format_strÚMode)rb   r  Údo_not_importrO   ÚdirectÚfrom_importsrº  r‘   rê  Úfrom_ÚheaderÚnothingss               r8   Ú
_make_testrL  B  s°  € ð �<‰<˜ RÓ(×0Ñ0°¸bÓA€DØÐ'Ð)KÐLÑL€GØ˜tÑ#Ø�‰Ð,Ô-âE€MØ%,¨}Ñ%<ÖS Ä
È1ÌcÕ@R�˜�sŠmÐS€FÐSÜœsÓ#€LØ$+ÖD˜q¬z¸!¼UÕ/CšÒDò +‰ˆ�Ø×!Ñ!Ð"9Ô:¸tÄrÇzÁzÒ?QØ˜Ñ ×$Ñ$ TÕ*ð+ð
 *×/Ñ/Ó1÷áˆF�EÜ�fœcÔ" v°]Ñ'Bð 	×"Ñ" 6¨4¯9©9´V¸E³]Ó+CÕDð€Eñ ô
 ×"Ñ"¨4¯9©9´V¸F³^ÄfÈUÃmÑ5SÓ+TÐ"ÓU€FØ�z‰z˜.Ó)€HØ�1‚}ØÐQÑQ‰Ø	�QŠØÐPÑPˆÜ×Ñ˜F T™M´·
±
³Ô=Ð=ùò! TùâDùós   Á
GÁ GÁ<GÂGÃ,AGc                 óN   ‡ — g d¢}t        ‰ «      xr t        ˆ fd„|D «       «      S )N)rs  ÚnoutÚnargsÚntypesrÂ   ÚidentityÚ	signaturec              3   ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wr5   )rd  )rœ   r‘   r§  s     €r8   rž   z%_is_probably_ufunc.<locals>.<genexpr>j  s   øè ø€ Ò O¸¤¨¨d×!3Ñ Oùs   ƒ)r¥  Úall)r§  Úhas_attributess   ` r8   rr  rr  ^  s&   ø€ ò€Nô �C‹=ÒOœSÓ OÀÔ OÓOÐOr:   ))z	write(.+)zread{})zsave(.+)úload{})zdump(.+)rV  )zto(.+)zfrom{})z
(.*)en(.+)z{}de{})z(.+)zde{})z(?!safe)(.+)zun{})z(.+)2(.+?)(_.+)?z
{1}2{0}{2})z(.+)_to_(.+)z
{1}_to_{0})z(inet|if)_(.+)to(.+)z{0}_{2}to{1})z(\w)to(\w)(.+)z{1}to{0}{2})úsend(.+)zrecv{})rW  z	receive{}Úthingc           
      ór  ‡— i }t        | «      r| g}�nt        | t        j                  «      rôt	        | d«      r%| j
                  D �cg c]  }t        | |d «      ‘Œ }}nÑ| j                  }|�|j                  nd Št        | «      j                  «       D ��cg c]L  \  }}t        |«      r<t        |«      s1‰rt        |d‰«      j                  ‰«      r|j                  d«      s|‘ŒN }}}‰rCt        ˆfd„|D «       «      r/|D �cg c]  }t        |d‰«      ‰k(  sŒ|‘Œ }}nt        d| ›�«      ‚t        |«      D ]~  }t!        j"                  |«      sŒ|t        |«      j                  «       D ��cg c]>  \  }}t	        |d«      r-t        |«      s"|j                  d«      s|j%                  |«      ‘Œ@ c}}z  }Œ€ |D ]¼  }	 t        |«      s®t        |«      r£t'        |«      r˜t        |t(        j*                  «      s~t        | dd «      rUt!        j"                  | «      rt-        | «      t.        |<   n-t        | t        j                  «      r| j0                  t.        |<   	 t'        |«       ||t3        |d¬	«      <   Œ¾ |S c c}w c c}}w c c}w c c}}w # t4        $ r Y Œ%w xY w# t6        t8        f$ r Y Œ÷w xY w)
Nré  r^   r  c              3   ó>   •K  — | ]  }t        |d ‰«      ‰k(  –— Œ y­w)r^   N)rq   )rœ   r  Úpkgs     €r8   rž   z*_get_testable_functions.<locals>.<genexpr>œ  s   øè ø€ ÒOÀAœ7 1 l°CÓ8¸CÕ?ÑOùó   ƒz#Can't test non-module non-callable Ú__func__r6   TrS   )r¥  rJ   rÂ   Ú
ModuleTyperd  ré  rq   Ú__spec__ÚparentÚvarsrŽ  r   rN  r:  r   r=   r¬   ÚisclassÚ__get__r€  rº   ÚEnumMetarÌ  rÆ  r6   rN   rM   Ú	TypeErrorr©   )	rX  Úby_namer‰  r‘   Úspecr•  r–  r  r[  s	           @r8   Ú_get_testable_functionsrh  ˆ  sq  ø€ Ø€GÜ�„Ø#( 'ŠÜ	�Eœ5×+Ñ+Ô	,Ü�5˜)Ô$Ø<A¿M¹MÖJ°D”W˜U D¨$Õ/ÐJˆEÑJð —>‘>ˆDØ!%Ð!1�$—+’+°tˆCô ! ›K×-Ñ-Ó/÷á�A�qÜ˜A”;Ü œ
Ù¤'¨!¨\¸3Ó"?×"JÑ"JÈ3Ô"OØŸ™ SÔ)ò ðˆEñ ñ ”sÓOÈÔOÔOØ$)ÖR˜q¬W°Q¸ÀcÓ-JÈcÓ-QšÐR�ÑRäÐ CÀEÀ9ÐMÓNÐNä�%‹[ò ˆÜ�?‰?˜1ÕØä  ›GŸM™M›O÷á�A�qÜ˜1˜jÔ)´'¸!´*ÀQÇ\Á\ÐRUÔEVð —	‘	˜!•óñ ‰Eðð ò ˆð	ä˜Q”ZÜ˜Q”KÜ ”NÜ" 1¤d§m¡mÔ4ä˜5 *¨dÔ3Ü—‘ uÔ-Ü6HÈÓ6OÔ0°Ò3Ü# E¬5×+;Ñ+;Ô<Ø6;·n±nÔ0°Ñ3ðÜ ”NØEF�GœM¨!¸DÔAÑBøðð, €Nùòa Kùóùò Sùóøô* !ò ñ ðûô œ:Ð&ò 	Ùð	úsQ   ÁI?ÂAJÄJ
ÄJ
Å1AJ
ÇBJ$É JÊ	J!ÊJ$Ê J!Ê!J$Ê$J6Ê5J6r†  rg   ©rF   re   rî  Úmodules_or_functionsc                 ó´  ‡ ‡‡ ‡!‡"— t        ‰ «      Š t        ‰«       |st        d«      ‚g Š"i }t        «       Š |D �]@  }|j	                  t        |«      x}«       |rŒ#t        |t        j                  «      sŒ>d|j                  › d|j                  ›d�}g }t        t        j                  t        ¬«      D ]�  }	|	j                  |j                  › d�«      sŒ"d|	j!                  |j                  «      vsŒ@|	j                  t#        d„ |D «       «      «      rŒbt        t        j                  |	   «      sŒ|j%                  |	«       Œ‘ |r |d	d
j'                  t        |«      «      › �z  }‰"j%                  |«       �ŒC |sdj'                  ‰"«      S |€t)        |j+                  «       Ž }ˆ ˆ ˆ"ˆfd„}
t,        D ]û  \  }}t        |«      D ]è  }t/        j0                  ||j3                  d«      d   «      }|sŒ. |j4                  |j7                  «       Ž Š!t        ˆ!fd„|D «       «      D ]2  } |
t8        |j;                  |«      |j;                  |«      f|¬«        Œ“ 	 t=        t        j                  t?        ||   «         ‰!«      }tA        |«        |
t8        |j;                  |«      |f|¬«       Œê Œý tE        tF        «      }t        |jI                  «       «      D ]"  \  }}|tK        |«         j%                  |«       Œ$ |j+                  «       D ]·  }t        |«      dk\  sŒt        |D �ch c]  }tM        tA        |«      «      ’Œ c}«      dk(  sŒAtO        «       }|D �ch c]  }tQ        |«      jS                  d|«      ’Œ }}t        ||hz
  «      dk  sŒ† |
tT        ||¬«       |D ]  }|j;                  tK        |d¬«      «       Œ  Œ¹ t        |jI                  «       «      D �]/  \  }}tQ        |«      }|j;                  dd«       tA        |«      }t        |«      t        |«      cxk(  rdk(  s.n t?        |«      dk(  sŒ]d|j                  vsŒlt#        |«      dv sŒz|j+                  «       xs tV        tV        g\  }}|\  }}||k(  sŒ¦t        |«      t        |«      cxk(  rdk  sŒÄn ŒÇdddddœjS                  |j                  d«      }t=        t        j                  t?        |«         |d«      } |
tX        ||j                  dk7  ||¬ «       ||= �Œ2 d!t        j                  v r?t        |jI                  «       «      D ]#  \  }}t[        |«      sŒ |
t\        ||¬«       ||= Œ% t        |jI                  «       «      D ]!  \  }} |
t^        |ta        |‰ ¬"«      d#|¬$«       Œ# tc        ‰ d%j'                  ‰"«      «      S # tB        $ r Y �Œw xY wc c}w c c}w )&aÄ  Guess which ghostwriters to use, for a module or collection of functions.

    As for all ghostwriters, the ``except_`` argument should be an
    :class:`python:Exception` or tuple of exceptions, and ``style`` may be either
    ``"pytest"`` to write test functions or ``"unittest"`` to write test methods
    and :class:`~python:unittest.TestCase`.

    After finding the public functions attached to any modules, the ``magic``
    ghostwriter looks for pairs of functions to pass to :func:`~roundtrip`,
    then checks for :func:`~binary_operation` and :func:`~ufunc` functions,
    and any others are passed to :func:`~fuzz`.

    For example, try :command:`hypothesis write gzip` on the command line!
    z2Must pass at least one function or module to test.z!# Found no testable functions in z (from rI   r;   r   z._c              3   ó&   K  — | ]	  }|› d �–— Œ y­w)r   Nr†  )rœ   Úms     r8   rž   zmagic.<locals>.<genexpr>ç  s   è ø€ Ò.E¸1°!°°A¬wÑ.Eùs   ‚zK
# Try writing tests for submodules, e.g. by using:
#     hypothesis write rÕ  z

Nc                 ój   •—  | |i |¤‰‰dœ¤Ž\  }}‰j                  |«       ‰j                  |«       y )N)rF   re   )r   r\   )	Úhowrm  rv  r¹  r  rF   rb   Úpartsre   s	        €€€€r8   Úmake_zmagic.<locals>.make_ø  s5   ø€ Ù˜ÐF ÐF°ÀÓF‰	ˆˆTØ�‰�sÔØ�‰�TÕr:   r|   c              3   óR   •K  — | ]  }|j                  d «      d   ‰k(  sŒ|–— Œ  y­w)r   r|   N)r¥   )rœ   rÏ  Úinverse_names     €r8   rž   zmagic.<locals>.<genexpr>  s*   øè ø€ ò $Ø¨!¯'©'°#«,°rÑ*:¸lÓ*J”Añ$ùs   ƒ' ')rî  r3   rU   r1   TrS   ÚoperatorÚitem))rC   rD   )ÚxÚyr'  r]   Úand_Úor_)ÚmulÚmatmulry  rx  rR   r{  )ÚcommutativeÚdistributes_overrî  ry   ©rF   Úfuzz)rà  rí  rî  rö  )2rP   ri   r   rX   r   rh  rJ   rÂ   r^  r6   Ú__file__rA   rƒ   r„   r_   rN  r¦   r@   r\   r`   r;  rx  ÚROUNDTRIP_PAIRSrm   r…   r¥   râ  r‡   Ú_make_roundtrip_bodyÚpoprq   r¦  r€  rM   r   r=   rŽ  rN   Ú	frozensetr  r   r‹   Ú_make_equiv_bodyr   Ú_make_binop_bodyrr  Ú_make_ufunc_bodyr  rå  rL  )#rF   re   rî  rj  rf  rX  ÚfoundÚmsgÚmodsr•  rq  Ú	writenameÚreadnamer‘   r¿   ÚotherÚ
other_funcrê  r  r  r¢   Úsentinelr  r  r”  rn  rC   rD   Úarg1Úarg2Úknownr}  rb   rs  rp  s#   ``                              @@@r8   Úmagicr“  Á  sV  ü€ ô( ˜GÓ$€GÜ�ÔÙÜÐRÓSÐSà€EØ€GÜ‹e€Gà%ó ˆØ�‰Ô 7¸Ó >Ð>�uÔ?Úœ: e¬U×-=Ñ-=Õ>Ø5°e·n±nÐ5EÀWÈUÏ^É^ÐL^Ð^_Ð`ˆCØˆDÜœCŸK™K¬SÔ1ò #�à—L‘L E§N¡NÐ#3°1Ð!5Õ6Ø A§N¡N°5·>±>Ó$BÒBØŸL™L¬Ñ.EÀÔ.EÓ)EÕFÜ/´·±¸A±Õ?à—K‘K •Nð#ñ Øð.Ø.1¯h©h´v¸d³|Ó.DÐ-EðGñ�ð �L‰L˜Öð%ñ( Ø�{‰{˜5Ó!Ð!àÐÜ(¨'¯.©.Ó*:Ð;ˆ÷ô  /ò Ñˆ	�8Ü˜7“Oò 	ˆDÜ—L‘L ¨D¯J©J°s«O¸BÑ,?Ó@ˆEÚØ.˜xŸ™°·±³Ð?�Ü#ó $Ø&ô$ó ò �Eñ Ü,Ø Ÿ™ TÓ*¨G¯K©K¸Ó,>Ð?Ø!)õñ
 ððÜ%,ÜŸK™K¬°G¸D±MÓ(BÑCØ(ó&˜
ô $ JÔ/ñ Ü0Ø$Ÿ[™[¨Ó.°
Ð;Ø%-öñ/	ðô@ œÓ€EÜ�w—}‘}“Ó'ò *‰ˆˆ1ØŒm˜AÓÑ×&Ñ& qÕ)ð*à—‘“ò GˆÜˆu‹:˜‹?œsÀuÖ#MÀ!¤I¬k¸!«nÕ$=Ò#MÓNÐRSÓSÜ“xˆHØJOÖPÀQ”~ aÓ(×,Ñ,¨X°xÕ@ÐPˆGÐPÜ�7˜h˜ZÑ'Ó(¨AÓ-ÙÔ&¨¸ÕAØò G�AØ—K‘K¤¨aÀÔ EÕFñGðGô ˜WŸ]™]›_Ó-ó "‰
ˆˆdÜ˜tÓ$ˆØ�	‰	�(˜DÔ!Ü˜TÓ"ˆÜ�‹Jœ#˜f›+Ô*¨Ô*Ü˜Ó Ó+Ø˜dŸm™mÒ+Ü�f“Ð!9Ò9à—<‘<“>Ò/¤c¬3 Z‰DˆAˆqØ‰JˆD�$Ø�A‹vœ#˜d›)¤s¨4£yÔ5°AÖ5ð !Ø#Ø!Ø!ñ	÷
 ‘#�d—m‘m RÓ(ð ô $+¬3¯;©;´{À4Ó7HÑ+IÈ5ÐRVÓ#WÐ ÙÜ$ØØ $§¡°Ñ 9Ø%5Ø%õð ˜D’Mð7"ð< ”#—+‘+ÑÜ  §¡£Ó1ò 	"‰JˆD�$Ü! $Õ'ÙÔ&¨°xÕ@Ø˜D‘Mð	"ô �w—}‘}“Ó'ò 
‰ˆˆ1ÙÜØÜ! !¨WÔ5ØØö	
ð
ô �g˜tŸy™y¨Ó/Ó0Ð0øôQ %ò Úðüò $NùâPs   É4W Ì,W
Í "W× 	W×Wc                óÐ   — t        | «      st        d| ›�«      ‚t        |«      }t        |«       |€t	        | «      }t        | t        | |¬«      |d||¬«      \  }}t        ||«      S )aÃ  Write source code for a property-based test of ``func``.

    The resulting test checks that valid input only leads to expected exceptions.
    For example:

    .. code-block:: python

        from re import compile, error

        from hypothesis.extra import ghostwriter

        ghostwriter.fuzz(compile, except_=error)

    Gives:

    .. code-block:: python

        # This test code was written by the `hypothesis.extra.ghostwriter` module
        # and is provided under the Creative Commons Zero public domain dedication.
        import re

        from hypothesis import given, reject, strategies as st

        # TODO: replace st.nothing() with an appropriate strategy


        @given(pattern=st.nothing(), flags=st.just(0))
        def test_fuzz_compile(pattern, flags):
            try:
                re.compile(pattern=pattern, flags=flags)
            except re.error:
                reject()

    Note that it includes all the required imports.
    Because the ``pattern`` parameter doesn't have annotations or a default argument,
    you'll need to specify a strategy - for example :func:`~hypothesis.strategies.text`
    or :func:`~hypothesis.strategies.binary`.  After that, you have a test!
    úGot non-callable func=r~  r  ©rà  rF   rí  re   rî  )r¥  r   rP   ri   r;  r  rå  rL  ©r  rF   re   rî  rb   r  s         r8   r  r  ^  sw   € ôZ �DŒ>ÜÐ 7°$°Ð9Ó:Ð:Ü˜GÓ$€GÜ�ÔàÐÜ(¨Ó.ˆä#ØÜ˜d¨GÔ4ØØØØô�M€GˆTô �g˜tÓ$Ð$r:   c                ó   — t        | «      st        d| ›�«      ‚t        |«      }t        |«       |€t	        | «      }t        | dj                  t        | |¬«      t        | d|¬«      «      |t        |dd«      d||¬«      \  }}t        ||«      S )aÈ  Write source code for a property-based test of ``func``.

    The resulting test checks that if you call ``func`` on it's own output,
    the result does not change.  For example:

    .. code-block:: python

        from typing import Sequence

        from hypothesis.extra import ghostwriter


        def timsort(seq: Sequence[int]) -> Sequence[int]:
            return sorted(seq)


        ghostwriter.idempotent(timsort)

    Gives:

    .. code-block:: python

        # This test code was written by the `hypothesis.extra.ghostwriter` module
        # and is provided under the Creative Commons Zero public domain dedication.

        from hypothesis import given, strategies as st


        @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers())))
        def test_idempotent_timsort(seq):
            result = timsort(seq=seq)
            repeat = timsort(seq=result)
            assert result == repeat, (result, repeat)
    r•  zresult = {}
repeat = {}r~  ÚresultÚrepeatrð  ©rà  rF   rì  rí  re   rî  )
r¥  r   rP   ri   r;  r  râ  rå  r›  rL  r—  s         r8   rð  rð  ž  sŸ   € ôR �DŒ>ÜÐ 7°$°Ð9Ó:Ð:Ü˜GÓ$€GÜ�ÔàÐÜ(¨Ó.ˆä#ØØ,×3Ñ3Ü˜ gÔ.Ü˜˜h°Ô8ó
ð Ü˜e X¨xÓ8ØØØô�M€GˆTô �g˜tÓ$Ð$r:   c                 ó  ‡— t        t        t        | d   «      «      «      }t        | d   d‰¬«      gˆfd„t	        | dd  «      D «       ¢}t        | dj                  |«      ‰t        ||dt        | «      dz
  › �«      d||d	œŽS )
Nr   Úvalue0©r×  rF   c              3   óT   •K  — | ]  \  }}t        |d |› �d |dz   › �‰¬«      –— Œ! y­w)ÚvaluerU   rž  N)rå  )rœ   rO   r  rF   s      €r8   rž   z'_make_roundtrip_body.<locals>.<genexpr>â  s;   øè ø€ ò 

á��1ô ˜˜U 1 #˜;°°q¸1±u°g¨È×PÐPñ

ùs   ƒ%(rU   rö  r   rñ  r›  )	rŒ  r�  r€  rå  rK   r  r`   r›  r_   )r‰  rF   re   rî  Úfirst_paramÚ
test_liness    `    r8   r‚  r‚  Þ  s•   ø€ Ü”tœK¨¨a©Ó1Ó2Ó3€Kä�E˜!‘H X°wÔ?ðó

ä! %¨¨ )Ó,ô

ð€Jô Ø	Ø—)‘)˜JÓ'ØÜ˜e [°E¼#¸e»*Àq¹.Ð9IÐ2JÓKØØØòð r:   c                 óâ   — |st        d«      ‚t        |«      D ]!  \  }}t        |«      rŒt        d|› d|›�«      ‚ t        | «      } t	        |«       |€t        |Ž }t        t        || ||«      Ž S )a5  Write source code for a property-based test of ``funcs``.

    The resulting test checks that if you call the first function, pass the result
    to the second (and so on), the final result is equal to the first input argument.

    This is a *very* powerful property to test, especially when the config options
    are varied along with the object to round-trip.  For example, try ghostwriting
    a test for :func:`python:json.dumps` - would you have thought of all that?

    .. code-block:: shell

        hypothesis write --roundtrip json.dumps json.loads
    z,Round-trip of zero functions is meaningless.úGot non-callable funcs[rH   )r   rK   r¥  rP   ri   r;  rL  r‚  )rF   re   rî  r‰  rO   r  s         r8   rñ  rñ  ò  sˆ   € ñ& ÜÐLÓMÐMÜ˜%Ó ò H‰ˆˆ1Ü˜�{Ü!Ð$;¸A¸3¸bÀÀÐ"FÓGÐGðHô ˜GÓ$€GÜ�ÔàÐÜ(¨%Ð0ˆäÔ+¨E°7¸EÀ8ÓLÐMÐMr:   c           	      óˆ  — | D �cg c]  }d|j                   › �‘Œ }}t        t        |«      «      t        |«      k  r(| D �cg c]  }d|j                   › dt        |«      › �‘Œ }}t        t        |«      «      t        |«      k  r-t	        | «      D ��cg c]  \  }}d|› d|j                   › �‘Œ }}}|S c c}w c c}w c c}}w )NÚresult_r  )r6   r_   rX   r¦  rK   )r‰  r  Ú	var_namesrO   s       r8   Ú_get_varnamesr¨    s±   € Ø16Ö7¨A�7˜1Ÿ:™:˜,Ò'Ð7€IÐ7Ü
Œ3ˆy‹>ÓœS ›^Ò+ØFKÖLÀ�w˜qŸz™z˜l¨!¬K¸«NÐ+;Ò<ÐLˆ	ÐLÜ
Œ3ˆy‹>ÓœS ›^Ò+Ü<EÀeÓ<L×M±D°A°q�w˜q˜c  1§:¡: ,Ò/ÐMˆ	ÑMØÐùò 8ùâLùãMs   …B4Á"B9ÂB>c           
      óú   ‡‡— t        | «      Št        ‰| d¬«      D ��cg c]  \  }}t        |||¬«      ‘Œ }}}dj                  ˆˆfd„‰dd  D «       «      }t	        | dj                  |«      ||d‰|dœŽS c c}}w )	NT©r×   rž  rö  c              3   ó>   •K  — | ]  }t        ‰‰d    |«      –— Œ y­w)r   N)r›  )rœ   Úvnamere   r§  s     €€r8   rž   z#_make_equiv_body.<locals>.<genexpr>"  s#   øè ø€ ò Ø38Œ
�5˜) A™,¨×.ñùr\  rU   Ú
equivalentr›  )r¨  Úziprå  r`   r  )	r‰  rF   re   rî  r¬  r  r¢  rì  r§  s	     `     @r8   r…  r…    s—   ù€ Ü˜eÓ$€Iô ˜I u°TÔ:÷áˆE�1ô 	�A˜e¨WÖ5ð€Jñ ð —‘ô Ø<EÀaÀb¸Môó €Jô Ø	Ø—)‘)˜JÓ'ØØØØØòð ùós   ŸA7zx
try:
{}
    exc_type = None
    target(1, label="input was valid")
{}except Exception as exc:
    exc_type = type(exc)
zN
if exc_type:
    with {ctx}(exc_type):
{check_raises}
else:
{call}
{compare}
c                 óx  — t        | «      }| ^}}t        ||d   |¬«      }t        |«      \  }}	|j                  d«       |	rd|	› d�nd}
t        j                  t        |d¬«      |
«      g}t        |d	d  |d
¬«      D ]”  \  }}|dk(  rd}|j                  d«       n	|dk(  sJ ‚d}t        j                  |t        t        |d¬«      d«      t        t        ||d¬«      d«      t        t        ||d   |«      d«      ¬«      }|j                  |«       Œ– t        | dj                  |«      dd||dœŽ\  }}||z  |fS )Nr   rž  )r=  r¶  zexcept z:
    reject()
rR   rÝ  rÞ  rU   Trª  rg   zpytest.raisesrh   zself.assertRaisesr†  r~  z        )ÚctxÚcheck_raisesrã  Úcomparerö  r­  r–  )r¨  rå  rd   r]   ÚEQUIV_FIRST_BLOCKrâ  r   r®  ÚEQUIV_CHECK_BLOCKr›  r\   r  r`   )r‰  rF   re   rî  r§  ÚfirstÚrestÚ
first_callÚextra_importsr”   Úcatchr¢  r¬  r  r°  Úblockrb   Úsource_codes                     r8   Ú_make_equiv_errors_bodyr¼  D  se  € Ü˜eÓ$€IØ€L€EˆDÜ˜U¨9°Q©<ÀÔI€JÜ/°Ó8Ñ€M�8Ø×ÑÐ.Ô/Ù5=ˆg�h�ZÐ0Ñ1À2€EÜ#×*Ñ*¬6°*ÀVÔ+LÈeÓTÐU€Jä˜	 ! "˜ t°DÔ9ò !‰ˆˆqØ�HÒØ!ˆCØ×Ñ˜hÕ'à˜JÒ&Ð&Ð&Ø%ˆCÜ!×(Ñ(ØÜ¤¨A°rÔ :¸JÓGÜœ A¨e¸RÔ@À&ÓIÜœ: e¨Y°q©\¸5ÓAÀ6ÓJð	 )ó 
ˆð 	×Ñ˜%Õ ð!ô +Ø	Ø—)‘)˜JÓ'ØØØØòÑ€Gˆ[ð �]Ñ" KÐ/Ð/r:   )Úallow_same_errorsrF   re   rî  r½  c                 óz  — t        |«      dk  rt        d«      ‚t        |«      D ]!  \  }}t        |«      rŒt        d|› d|›�«      ‚ t	        t
        | d«       t        |«      }t        |«       |€t        |Ž }| r$t        d„ |D «       «      st        ||||«      \  }}nt        ||||«      \  }}t        ||«      S )aÓ  Write source code for a property-based test of ``funcs``.

    The resulting test checks that calling each of the functions returns
    an equal value.  This can be used as a classic 'oracle', such as testing
    a fast sorting algorithm against the :func:`python:sorted` builtin, or
    for differential testing where none of the compared functions are fully
    trusted but any difference indicates a bug (e.g. running a function on
    different numbers of threads, or simply multiple times).

    The functions should have reasonably similar signatures, as only the
    common parameters will be passed the same arguments - any other parameters
    will be allowed to vary.

    If allow_same_errors is True, then the test will pass if calling each of
    the functions returns an equal value, *or* if the first function raises an
    exception and each of the others raises an exception of the same type.
    This relaxed mode can be useful for code synthesis projects.
    r3   z'Need at least two functions to compare.r¤  rH   r½  c              3   ó<   K  — | ]  }t        t        |«      –— Œ y ­wr5   )r>   rM   )rœ   rc   s     r8   rž   zequivalent.<locals>.<genexpr>Œ  s   è ø€ Ò$QÀ2¤Z´	¸2×%>Ñ$Qùs   ‚)r_   r   rK   r¥  r   r¸   rP   ri   r;  r:  r¼  r…  rL  )	r½  rF   re   rî  r‰  rO   r  rb   r»  s	            r8   r­  r­  g  sÎ   € ô2 ˆ5ƒz�A‚~ÜÐGÓHÐHÜ˜%Ó ò H‰ˆˆ1Ü˜�{Ü!Ð$;¸A¸3¸bÀÀÐ"FÓGÐGðHô ŒtÐ&Ð(;Ô<Ü˜GÓ$€GÜ�ÔàÐÜ(¨%Ð0ˆá¤Ñ$QÈÔ$QÔ!QÜ6°u¸gÀuÈhÓWÑˆ‘ä/°°wÀÀxÓPÑˆ�Ü�g˜{Ó+Ð+r:   ÚXÚY©Úassociativer|  rQ  r}  rF   re   rî  rÃ  r|  rQ  r}  c          
      ó†  — t        | «      st        d| ›�«      ‚t        |«      }t        |«       t	        t
        |d«       t	        t
        |d«       |�&t        |«      st        d|›d| j                  › �«      ‚t        ||||g«      st        d«      ‚|€t        | «      }t        | |||||||¬«      \  }}	t        ||	«      S )a‚  Write property tests for the binary operation ``func``.

    While :wikipedia:`binary operations <Binary_operation>` are not particularly
    common, they have such nice properties to test that it seems a shame not to
    demonstrate them with a ghostwriter.  For an operator ``f``, test that:

    - if :wikipedia:`associative <Associative_property>`,
      ``f(a, f(b, c)) == f(f(a, b), c)``
    - if :wikipedia:`commutative <Commutative_property>`, ``f(a, b) == f(b, a)``
    - if :wikipedia:`identity <Identity_element>` is not None, ``f(a, identity) == a``
    - if :wikipedia:`distributes_over <Distributive_property>` is ``+``,
      ``f(a, b) + f(a, c) == f(a, b+c)``

    For example:

    .. code-block:: python

        ghostwriter.binary_operation(
            operator.mul,
            identity=1,
            distributes_over=operator.add,
            style="unittest",
        )
    r•  rÃ  r|  zdistributes_over=z- must be an operation which distributes over zFYou must select at least one property of the binary operation to test.rÂ  )r¥  r   rP   ri   r   r¸   r6   r:  r;  r†  rL  )
r  rÃ  r|  rQ  r}  rF   re   rî  rb   r  s
             r8   Úbinary_operationrÅ  —  së   € ôF �DŒ>ÜÐ 7°$°Ð9Ó:Ð:Ü˜GÓ$€GÜ�ÔÜŒt�[ -Ô0ÜŒt�[ -Ô0ØÐ#¬HÐ5EÔ,FÜØ ÐÐ!ð " Ø $§¡˜ð0ó
ð 	
ô �˜[¨(Ð4DÐEÔFÜØTó
ð 	
ð ÐÜ(¨Ó.ˆä$ØØØØØ)ØØØô	�M€GˆTô �g˜tÓ$Ð$r:   )rÃ  r|  rQ  r}  c                ó¾  ‡ ‡‡‡‡‡‡‡— t        ‰ «      Šˆfd„t        t        ‰ «      «      d d D «       \  }}	t        |«      t        |	«      k7  r||	z  }‰ j                  dz   Št        «       Šg Š	 d$dt        dt        dt        dt        d z  dd f
ˆˆˆˆ ˆˆˆˆfd	„}
|r; |
d
dt        ‰ dt        ‰ dd«      d¬«      t        ‰ t        ‰ dd«      dd¬«      «       |r% |
ddt        ‰ ddd¬«      t        ‰ ddd¬«      «       |�Š|du r 	 t        |d„ t        ¬«      }t        |«      }nt        |«      }	 t        |dd«       d|› �t        ‰dt        ‰ dd«      «      t        ‰dt        ‰ dd«      «      g} |
dddj                  |«      «       |r½|}t        ‰ dt        |dd«      d¬«      t        |t        ‰ dd«      t        ‰ dd«      d¬«      t        ‰dd«      dt        ‰ t        |dd«      dd¬«      t        |t        ‰ dd«      t        ‰ dd«      d¬«      t        ‰dd«      g} |
|j                  dz   ddj                  |«      «       t        |«      \  }}‰j!                  |«       t#        |«      }d}‰d k(  rd!‰ j                  › d"�}‰|‰› d#|› d�z   dj                  ‰«      z   fS # t        $ r t        d«      }Y �Œ‘w xY w# t        $ r t        |«      }Y �Œžw xY w)%Nc              3   ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr5   )rƒ  )rœ   r  r   s     €r8   rž   z#_make_binop_body.<locals>.<genexpr>æ  s   øè ø€ ÒJ¨�:—>‘> !×$ÑJùs   ƒr3   Ú	_operandsÚsub_propertyrm  r  Úrightr1   c                 ó2  •— |€d}n|› d|› �}t        ‰dd«      }t        ‰|| dz   ‰
|‰i ‰¥|D �ci c]  }|‰“Œ c}¥‰	¬«      \  }}‰j                  |«       ‰dk(  r%d}||j                  |«      t	        |«      z   d	z   d  }‰j                  |«       y c c}w )
NrR   rö  ÚleftrÊ  Ú_binary_operation)rà  rí  rF   rì  re   r“  rî  rh   z(unittest.TestCase):
rU   )r›  r  r   r3  r_   r\   )rÉ  rm  r  rÊ  rì  rÏ  rb   ÚendlineÚall_importsrî  rF   r  Úoperands_namerp  r   re   s           €€€€€€€€r8   Úmakerz_make_binop_body.<locals>.makerî  sÆ   ø€ ð ˆ=Ø‰Jà�V˜2˜e˜WÐ%ˆDÜ# E¨6°7Ó;ˆJÜ'ØØØÐ!4Ñ4ØØ!ØØO 
ÐOÈÖ.NÀA¨q°-Ñ/?Ò.NÐOØô	
‰ˆ�ð 	×Ñ˜7Ô#Ø�JÒØ.ˆGØ˜Ÿ
™
 7Ó+¬c°'«lÑ:¸QÑ>Ð@ÐAˆDØ�‰�TÕùò /Os   °
BrÃ  ÚabcrC   rD   rÉ  rÌ  )r×  r|  Úab.c                  ó   — y)NTr†  )rv  s    r8   r9   z"_make_binop_body.<locals>.<lambda>"  s   � r:   )r   zidentity element hererŸ   Úexeczidentity = rQ  rö  ÚldistÚrdistÚ_distributes_overrR   rh   zclass TestBinaryOperationz(unittest.TestCase):
    rÜ  r5   )r™  r=   r€  r¯   r6   rX   rl   rå  r   Ú_quietly_settingsrM   rn   rª   r›  r`   r‘  r   rë  )r  rÃ  r|  rQ  r}  rF   re   rî  ÚoperandsrD   rÑ  Úidentity_reprÚidentity_partsÚdoÚ
dist_partsÚoperands_importsÚoperands_reprÚclassdefrÏ  rÐ  rp  r   s   `    ```          @@@@r8   r†  r†  Ú  s=  ÿ€ ô ! Ó&€JÛJ¬d´;¸tÓ3DÓ.EÀbÀqÐ.IÔJ�K€HˆaÜˆHƒ~œ˜a›Ò Ø�A‰ˆØ—M‘M KÑ/€Mä“%€KØ€Eð !ñ	Üðäðô ðô �T‰zð	ð
 
÷ô ñ6 ÙØØÜ˜˜c¤;¨t°S¸#Ó#>ÀvÔNÜØÜ˜D # sÓ+ØØô	ô	
	
ñ ÙØØÜ˜˜c 3¨vÔ6Ü˜˜c 3¨wÔ7ô		
ð Ðð �s‰?ð/Ü ©.ÔCTÔU�ô !% X£‘ä  ›NˆMð	0ô
 �M :¨vÔ6ð ˜-˜Ð)ÜØØÜ˜D # zÓ2óô
 ØØÜ˜D *¨cÓ2óð
ˆñ 	ˆj˜#˜tŸy™y¨Ó8Ô9ÙØˆä˜˜c¤;¨r°3¸Ó#<ÀVÔLÜØÜ˜D # sÓ+Ü˜D # sÓ+Øô	ô �u˜g vÓ.ØÜ˜œk¨"¨c°3Ó7¸ÀWÔMÜØÜ˜D # sÓ+Ü˜D # sÓ+Øô	ô �u˜g wÓ/ð#
ˆ
ñ& 	ˆb�k‰kÐ/Ñ/°¸¿	¹	À*Ó8MÔNä&8¸Ó&BÑ#Ð�mØ×ÑÐ'Ô(Ü& }Ó5€MØ€HØ�
ÒØ.¨t¯}©}¨oÐ=WÐXˆàØ�m�_ C¨ °bÐ9Ñ9¸D¿I¹IÀeÓ<LÑLðð øôy ò >Ü $Ð%<Ó =“ð>ûô ò 	0Ü  Ó/‹Mð	0ús$   ÄJ) Ä0K Ê)KË KËKËKc                ó¦   — t        | «      st        d| ›d�«      ‚t        |«      }t        |«       |€t	        | «      }t        t        | |||¬«      Ž S )aÍ  Write a property-based test for the :doc:`array ufunc <numpy:reference/ufuncs>` ``func``.

    The resulting test checks that your ufunc or :doc:`gufunc
    <numpy:reference/c-api/generalized-ufuncs>` has the expected broadcasting and dtype casting
    behaviour.  You will probably want to add extra assertions, but as with the other
    ghostwriters this gives you a great place to start.

    .. code-block:: shell

        hypothesis write numpy.matmul
    zfunc=z does not seem to be a ufuncri  )rr  r   rP   ri   r;  rL  r‡  )r  rF   re   rî  s       r8   Úufuncrã  e  s^   € ô$ ˜dÔ#Ü   Ð'CÐDÓEÐEÜ˜GÓ$€GÜ�ÔàÐÜ(¨Ó.ˆäÜ	˜$¨°uÀxÔ	Pðð r:   c                ó  — dd l mc m} | j                  €|j	                  | j
                  ¬«      }n|j	                  | j                  ¬«      }|j                  |j                  _        dj                  dj                  t        d | j
                   «      t        | gt        d | j
                   ¢­d|iŽ¬«      }dj                  t        |d	d
«      t        |dd«      ¬«      }t        | d¬«      }| j                  D �	cg c]  }	d|	v ‘Œ }
}	t!        |
«      st#        |
«      sd|› d�}nd|› d�}t%        | t'        |«      j)                  «       ||| j                  €dnd|t+        j,                  «       ||dœdh|¬«	      S c c}	w )Nr   )Ú
num_shapes)rR  aI  
    input_shapes, expected_shape = shapes
    input_dtypes, expected_dtype = types.split("->")
    array_strats = [
        arrays(dtype=dtp, shape=shp, elements={{"allow_nan": True}})
        for dtp, shp in zip(input_dtypes, input_shapes)
    ]

    {array_names} = data.draw(st.tuples(*array_strats))
    result = {call}
    rW   rF   )Úarray_namesrã  z
{shape_assert}
{type_assert}zresult.shapeÚexpected_shapezresult.dtype.charÚexpected_dtype)Úshape_assertÚtype_assertTrS   ÚOzsampled_from(z.types)zsampled_from([sig for sig in z.types if 'O' not in sig])rã  Úgufunc)ÚdataÚshapesrÂ   )zhypothesis.extra.numpyÚarrays)rà  rF   rì  rí  re   r“  rb   rî  )Úhypothesis.extra.numpyÚextrary   rR  Úmutually_broadcastable_shapesrs  r6   r  r^   râ  r`   r   rå  r›  rN   rÂ   rT  r:  r  r   r¤   r°   rí  )r  rF   re   rî  Únpstrî  r  rì  rÖ  ÚsigÚobj_sigsrÂ   s               r8   r‡  r‡  „  sy  € ß)Ð)à‡~�~ÐØ×3Ñ3¸t¿x¹xÐ3ÓH‰à×3Ñ3¸d¿n¹nÐ3ÓMˆØ!%§¡€F‡O�OÔð
÷ 	‰Ø—I‘Iœo¨j°·±Ð9Ó:Ü˜ÐM¤°
°$·(±(Ð ;ÒMÀWÑMð 	ó 	ð 	ð 3×9Ñ9Ü  ~Ð7GÓHÜ˜uÐ&9Ð;KÓLð :ó €Jô
 ˜$¨tÔ4€EØ&*§j¡jÖ1˜s��s’
Ð1€HÐ1Ü
ˆ8„}œC œMØ ˜w gÐ.‰à/°¨wÐ6PÐQˆäØÜ˜“,×$Ñ$Ó&ØØØŸ™Ð/‰g°XØÜ"$§'¡'£)°vÈÑNØ5Ð6Øô
ð 
ùò 2s   Ã?E?)œrY  r§   r[   r“   rº   r¬   r¿  rm   rƒ   rÂ   r¬  Úcollectionsr   r   Úcollections.abcr   r   r   Ú	itertoolsr   r	   Úkeywordr
   rj  rF  r   Útextwrapr   r   r   r  r   r   r   r   r   r   rC  r=  r   r   r   r   r°   Úhypothesis.errorsr   r   Úhypothesis.internal.compatr   Úhypothesis.internal.reflectionr   r   Úhypothesis.internal.validationr   Úhypothesis.provisionalr   Ú+hypothesis.strategies._internal.collectionsr    Ú$hypothesis.strategies._internal.corer!   Ú(hypothesis.strategies._internal.deferredr"   Ú*hypothesis.strategies._internal.flatmappedr#   Ú$hypothesis.strategies._internal.lazyr$   r%   Ú*hypothesis.strategies._internal.strategiesr&   r'   r(   r)   Ú%hypothesis.strategies._internal.typesr*   r+   rB  r  r¤   rá  rL   rM   r@   ÚExceptrX   rl   Ú	ImportSetrÙ   rÙ  rE   rP   rd   ri   ru   rˆ   r–   r­   r£  rÄ   rO  rQ  rR  rV  r¼   r=   rp  rt  r’  r€  r{  Úcontextmanagerr‡  r¸   r™  r›  rŸ  r¤  r‘  rÆ  r  r  rÌ  r¦  rN   rå  rë  r  r  r  r  r  r!  r  r;  rL  rr  r�  rh  r^  r“  r  rð  r‚  rñ  r¨  r…  r³  Úrstripr´  r¼  r­  rÀ  rÁ  rÅ  r†  rã  r‡  r†  r:   r8   ú<module>r     s=	  ðò=ó~ Û Û Û Û Û 	Û 	Û 
Û Û ß 0ß 7Ñ 7ß /Ý +Ý "ß #Ý ÷÷ ó ç BÓ Bß FÝ 5ß AÝ 5Ý *Ý DÝ ?Ý EÝ Fß P÷ó ÷ Wð€ð€ð÷
 
�EƒGð ð 
ˆi‰˜5  i¡°#Ð!5Ñ6Ñ	6€Ø��e˜C ˜H‘oÑ%Ñ&€	ÙØØØØ�o‰oô	Ð ð<˜E $ y¡/°3Ð"6Ñ7ð <¸EÀ$ÀyÁ/ÐSVÐBVÑ<Wó <ð˜6ð  e¨D°©O¸SÐ,@Ñ&Aó ð"˜u T¨)¡_°cÐ%9Ñ:ð ¸uÀYÐPSÀ^Ñ?Tó ð Y˜ð Y ó Yð
4 Cð 4¨E°$°y±/À3Ð2FÑ,Gó 4ð$; 3ð ;¨4°$©;ó ;ò8ð:?˜×*Ñ*ð :?°sð :?¸r×?PÑ?Pó :?ð|€
ðÐ ð€ð€ð^ Sð ^¨R×->Ñ->ó ^ðB ð ¨d°7×3DÑ3DÑ.Eó ð@˜Hð ¨¨g×.?Ñ.?Ñ)@ó ð#�hð # 4¨¨W×->Ñ->Ð(>Ñ#?ó #ð<UØ�W×&Ñ&Ñ'ðUà	ˆ#ˆw× Ñ Ð
 Ñ!óUð ×Ññ)ó ð)ð& 8=ò*2Øð*2Ø04ð*2à	ˆ#ˆr× Ñ Ð
 Ñ!ó*2ðZ �cð  ˜cð   cð  ¨có  òò65òp4"ðr /1Ð ˜$˜v s˜{Ñ+Ó 0òò(ð" 7<ò �sð ¨tð Àó ð =FÐUWò!Ø
ð!Ø%(ð!Ø39ð!ØORð!àó!ðHP˜#ð P #ó Pð àEIØ $òGØðGàðGð ðGð �4˜	‘? CÐ'Ñ(ð	Gð
 ðGð ðGð ˜c 3¨×):Ñ):Ñ#:Ð:Ñ;¸dÑBðGð ˜ÑðGð ðGð ˆ9�cˆ>ÑóGðT-Ø�s‰mð-Ø$,¨XÑ$6ð-ØAJð-àˆc�]ó-ô0�jô ð
Ø˜‘ Ñ$ðØ/8ðàˆ4�Zóð,XØ˜C  S¡˜MÑ*¨TÑ1ðXà˜/¨DÑ0Ñ1ðXð �tÑóXð4Ø˜/¨DÑ0Ñ1ðà
ˆ4�‰9�c˜#‘hÐÑ $Ñ&óðT¨ð T°À$Ñ0Fó Tðn	 hð 	°4ó 	ð>˜	ð >¨ð >°ó >ò8Pð$€ð06 6ð 6¨d°3¸°=Ñ.Aó 6ðv ØØ ò	Z1Ø# e×&6Ò&6Ñ6ðZ1àðZ1ð ðZ1ð �T‰kð	Z1ð
 	óZ1ð@ ØØ ò=%Ø
ð=%ð ð=%ð ð	=%ð
 �T‰kð=%ð 	ó=%ðF ØØ ò=%Ø
ð=%ð ð=%ð ð	=%ð
 �T‰kð=%ð 	ó=%ò@ð, ØØ ò	NØðNàðNð ðNð �T‰kð	Nð
 	óNòBòð*÷ 
�EƒGð ð÷ ‚FƒHð ò 0ðJ $ØØØ ò),Øð),àð),ð ð),ð ð	),ð
 �T‰kð),ð 	ó),ñX ˆCƒL€ÙˆCƒL€ð ØØ(+Ø37ØØØ ò@%Ø
�A�q�6˜1�9Ñ
ð@%ð ð@%ð ð	@%ð
 �,Ñ Ñ%ð@%ð   1˜v q˜yÑ)¨DÑ0ð@%ð ð@%ð ð@%ð �T‰kð@%ð 	ó@%ðL ØØ(+Ø37òHØ
�A�q�6˜1�9Ñ
ðHð ðHð ð	Hð
 �,Ñ Ñ%ðHð   1˜v q˜yÑ)¨DÑ0ðHð �4˜	‘? CÐ'Ñ(ðHð ðHð ðHð ˆ9�cˆ>ÑóHð\ ØØ òØ
ðð ðð ð	ð
 �T‰kðð 	óó>-r:   