ó
    ×›‘hƒ  ã            	       ó  • % S r SSKJrJr  SSKJrJrJrJrJ	r	  SSK
JrJr  \	" S5      r\	" S5      r\	" S5      rS\S	\\   S
\4S jrS\\/\4   S\\   S
\\   4S jrS\\   S\\   S
\4S jrS\\\/\4   S
\\\/\4   4S jrS\\/\4   S\\/\4   S
\\/\4   4S jr\" \R,                  \" \" \5      \" S5      5      5      r\\\   /\S   4   \S'   S\\/\4   S\/ \\   4   S
\4S jrS\\/\4   S
\/ \4   4S jrg)z1
General functional-style helpers for disttrial.
é    )ÚpartialÚwraps)Ú	AwaitableÚCallableÚIterableÚOptionalÚTypeVar)ÚDeferredÚsucceedÚ_AÚ_BÚ_CÚdefaultÚoptionalÚreturnc                 ó   • Uc  U $ U$ )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     ÚbC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/trial/_dist/functional.pyÚfromOptionalr      s   € ð ÑØˆØ€Oó    Ú	conditionÚxsc              #   óD   #   • U H  nU " U5      (       a  Uv •  M    g   g7f)zz
@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              ƒ   ó:   #   • U I Sh  v•N   UI Sh  v•N $  N N7f)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                 ó0   ^ • [        T 5      U 4S j5       nU$ )zW
Create a function like another but with the order of the first two
arguments flipped.
c                 ó   >• T" X5      $ ©Nr   )r   r   r    s     €r   ÚgÚflip.<locals>.g<   s   ø€ á�‹wˆr   ©r   )r    r$   s   ` r   Úflipr'   6   s"   ø€ ô ˆ1ƒXôó ðð €Hr   ÚfxÚfyc                 óP   ^ ^• [        T 5      [        T5      U U4S j5       5       nU$ )z}
Create a function that calls one function with an argument and then
another function with the result of the first function.
c                 ó    >• T" T" U 5      5      $ r#   r   )r   r(   r)   s    €€r   r$   Ú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              ƒ   óP   #   •  U" 5       I Sh  v•N nU " U5      (       d  U$ M    N7f)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/   r0   Úresults      r   ÚiterateWhiler3   X   s+   é € ð Ù“x—ˆÙ˜× Ñ ØˆMñ Ùùs   ‚&Ž$�&c                 ó,   ^ ^• SmS[         4UU 4S jjnU$ )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   >•  T" T5      n TS-  mU $ ! TS-  mf = f)Né   r   )r2   Úcounterr    s    €€r   r$   ÚcountingCalls.<locals>.gr   s,   ø€ ð	Ù�w“ZˆFà�q‰LˆGØˆøð �q‰L‰Gús   ƒ ’)r   )r    r$   r7   s   ` @r   ÚcountingCallsr9   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__r3   Úintr9   r   r   r   Ú<module>rB      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   