Ë
    ojƒ  ã            	       ó  — U d Z ddlmZmZ ddlmZmZmZmZm	Z	 ddl
mZmZ  e	d«      Z e	d«      Z e	d«      Zded	ee   d
efd„Zdeegef   dee   d
ee   fd„Zdee   dee   d
efd„Zdeeegef   d
eeegef   fd„Zdeegef   deegef   d
eegef   fd„Z eej,                   e ee«       ed«      «      «      Zeee   ged   f   ed<   deegef   deg ee   f   d
efd„Zdeegef   d
eg ef   fd„Zy)z1
General functional-style helpers for disttrial.
é    )ÚpartialÚwraps)Ú	AwaitableÚCallableÚIterableÚOptionalÚTypeVar)ÚDeferredÚsucceedÚ_AÚ_BÚ_CÚdefaultÚoptionalÚreturnc                 ó   — |€| S |S )zÂ
    Get a definite value from an optional value.

    @param default: The value to return if the optional value is missing.

    @param optional: The optional value to return if it exists.
    © )r   r   s     ú@/usr/lib/python3/dist-packages/twisted/trial/_dist/functional.pyÚfromOptionalr      s   € ð ÐØˆØ€Oó    Ú	conditionÚxsc              #   ó6   K  — |D ]  } | |«      r|–— Œ y y­w)z†
    :return: An iterable over C{xs} that stops when C{condition} returns
        ``False`` based on the value of iterated C{xs}.
    Nr   )r   r   Úxs      r   Ú	takeWhiler      s&   è ø€ ð
 ò ˆÙ�QŒ<Ø‹Gáñ	ùs   ‚ÚaÚbc              ƒ   ó:   K  — | ƒ d{  –—†  |ƒ d{  –—† S 7 Œ7 Œ­w)z³
    Wait for one action to complete and then another.

    If either action fails, failure is propagated.  If the first action fails,
    the second action is not waited on.
    Nr   )r   r   s     r   Úsequencer   +   s   è ø€ ð ‡G€GØ�7€Nð øØús   ‚ˆ‰	’“™Úfc                 ó.   ‡ — t        ‰ «      ˆ fd„«       }|S )zc
    Create a function like another but with the order of the first two
    arguments flipped.
    c                 ó   •—  ‰|| «      S ©Nr   )r   r   r    s     €r   Úgzflip.<locals>.g<   s   ø€ á��A‹wˆr   ©r   )r    r$   s   ` r   Úflipr&   6   s"   ø€ ô ˆ1ƒXóó ðð €Hr   ÚfxÚfyc                 óN   ‡ ‡— t        ‰ «      t        ‰«      ˆ ˆfd„«       «       }|S )z‰
    Create a function that calls one function with an argument and then
    another function with the result of the first function.
    c                 ó    •—  ‰ ‰| «      «      S r#   r   )r   r'   r(   s    €€r   r$   zcompose.<locals>.gI   s   ø€ ñ ‘"�Q“%‹yÐr   r%   )r'   r(   r$   s   `` r   Úcomposer+   C   s.   ù€ ô ˆ2ƒYÜ
ˆ2ƒYôó ó ðð €Hr   NÚdiscardResultÚ	predicateÚactionc              ƒ   óD   K  — 	  |«       ƒ d{  –—† } | |«      s|S Œ7 Œ­w)zò
    Call a function repeatedly until its result fails to satisfy a predicate.

    @param predicate: The check to apply.

    @param action: The function to call.

    @return: The result of C{action} which did not satisfy C{predicate}.
    Nr   )r-   r.   Úresults      r   ÚiterateWhiler1   X   s)   è ø€ ð Ù“x—ˆÙ˜Ô ØˆMð Øús   ‚ Ž� c                 ó(   ‡ ‡— dŠdt         fˆˆ fd„}|S )z’
    Wrap a function with another that automatically passes an integer counter
    of the number of calls that have gone through the wrapper.
    r   r   c                  ó8   •— 	  ‰‰«      } ‰dz  Š| S # ‰dz  Šw xY w)Né   r   )r0   Úcounterr    s    €€r   r$   zcountingCalls.<locals>.gr   s,   ø€ ð	Ù�w“ZˆFà�q‰LˆGØˆøð �q‰L‰Gús   ƒ ’)r   )r    r$   r5   s   ` @r   ÚcountingCallsr6   k   s   ù€ ð
 €GðŒrö ð €Hr   )Ú__doc__Ú	functoolsr   r   Útypingr   r   r   r   r	   Útwisted.internet.deferr
   r   r   r   r   r   Úboolr   r   r&   r+   ÚfromCoroutiner,   Ú__annotations__r1   Úintr6   r   r   r   ú<module>r?      sª  ðò÷ %ß CÕ Cç 4áˆTƒ]€ÙˆTƒ]€ÙˆTƒ]€ð
˜"ð 
¨°©ð 
¸ó 
ð	˜ 2 $¨ *Ñ-ð 	°8¸B±<ð 	ÀHÈRÁLó 	ð�i ‘mð ¨	°"©ð ¸"ó ð
ˆH�b˜"�X˜r�\Ñ"ð 
 x°°R°¸"°Ñ'=ó 
ð�˜"˜˜r˜Ñ"ð ¨°"°°r°Ñ(:ð ¸xÈÈÈbÈÑ?Qó ñ <CØ×ÑÙ‰D�‹N™G D›MÓ*ó<€ˆx˜ 2™˜¨°$©Ð7Ñ8ó ðØ˜˜˜d˜
Ñ#ðà�R˜ 2™Ð&Ñ'ðð óð&�X˜s˜e R˜iÑ(ð ¨X°b¸"°fÑ-=ô r   