JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/pip/_vendor/tenacity/__pycache__/__init__.cpython-39.opt-1.pyc

a

[��fQG�@s�ddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%ddl&m'Z'ddl&m(Z(ddl&m)Z)ddl&m*Z*ddl&m+Z+dd l&m,Z,dd!l&m-Z-dd"l&m.Z.dd"l&m.Z/dd#l0m1Z1dd$l0m2Z2dd%l3m4Z4dd&l3m5Z5dd'l6m7Z7dd(l6m8Z8dZ9ej:�r4ddl;Z;dd)l&m<Z<dd*lm=Z=ej>d+ej?d,�Z@e�>d-�ZAejBe@e@d.�d/d0��ZejBejCejCej?e@ge@fd1�d2d0��ZejCejCejDe@ej?e@ge@ffd1�d3d0�ZGd4d5�d5eE�ZFeG�ZHGd6d7�d7�ZIGd8d9�d9eJ�ZKGd:d;�d;�ZLGd<d=�d=eL�ZMeG�ZNejDejCeGfejCejCd>�d?d@�ZOGdAdB�dBeE�ZPGdCdD�dD�ZQGdEdF�dFe�ZRGdGdH�dHeR�ZSGdIdJ�dJejT�ZTGdKdL�dL�ZUddMlVmWZWe9�r�ddNlXmYZYdS)O�N)�ABC�abstractmethod)�futures)�iscoroutinefunction�)�
retry_base)�	retry_all)�retry_always)�	retry_any)�retry_if_exception)�retry_if_exception_type)�retry_if_not_exception_type)�retry_if_not_result)�retry_if_result)�retry_never)�retry_unless_exception_type)�retry_if_exception_message)�retry_if_not_exception_message��sleep)�sleep_using_event)�stop_after_attempt)�stop_after_delay)�stop_all)�stop_any)�
stop_never)�stop_when_event_set)�
wait_chain)�wait_combine)�wait_exponential)�
wait_fixed)�wait_incrementing)�	wait_none)�wait_random)�wait_random_exponential)�
before_log)�before_nothing)�	after_log)�
after_nothing)�before_sleep_log)�before_sleep_nothing)�	wait_base)�	stop_base�	WrappedFn)�bound�_RetValT)�fn�returncCsdS�N�)r0r3r3�A/usr/lib/python3.9/site-packages/pip/_vendor/tenacity/__init__.py�retryasr5)�dargs�dkwr1cOsdSr2r3�r6r7r3r3r4r5fscsDt��dkr&t�d�r&t��d�Sttd���fdd�}|SdS)z�Wrap a function with a new `Retrying` object.

    :param dargs: positional arguments passed to Retrying object
    :param dkw: keyword arguments passed to the Retrying object
    rr��fr1cs�t|t�r*t�d|jj�d|jj�d��t|�rBt�i���}n:trnt	tj
d�rntj
�|�rnt�i���}nt
�i���}|�|�S)NzGot retry_base instance (zQ) as callable argument, this will probably hang indefinitely (did you mean retry=z(...)?)�is_coroutine_function)�
isinstancer�warnings�warn�	__class__�__name__r�
AsyncRetrying�tornado�hasattr�genr;�TornadoRetrying�Retrying�wraps)r:�rr8r3r4�wrapvs
��zretry.<locals>.wrapN)�len�callabler5r-)r6r7rIr3r8r4r5ksc@seZdZdZdS)�TryAgainz/Always retry the executed function when raised.N)r@�
__module__�__qualname__�__doc__r3r3r3r4rL�srLc@seZdZdS)�	DoAttemptN�r@rMrNr3r3r3r4rP�srPc@seZdZdS)�DoSleepNrQr3r3r3r4rR�srRc@sReZdZUdZdZejeed<dZ	ej
eed<ed�dd�Zed�d	d
�ZdS)�
BaseActiona5Base class for representing actions to take by retry object.

    Concrete implementations must define:
    - __init__: to initialize all necessary fields
    - REPR_FIELDS: class variable specifying attributes to include in repr(self)
    - NAME: for identification in retry object methods and callbacks
    r3�REPR_FIELDSN�NAME�r1cs.d��fdd��jD��}�jj�d|�d�S)Nz, c3s"|]}|�dt�|���VqdS)�=N)�getattr)�.0Zfield��selfr3r4�	<genexpr>��z&BaseAction.__repr__.<locals>.<genexpr>�(�))�joinrTr?r@)r[Z	state_strr3rZr4�__repr__�szBaseAction.__repr__cCst|�Sr2)�reprrZr3r3r4�__str__�szBaseAction.__str__)
r@rMrNrOrT�t�Sequence�str�__annotations__rU�Optionalrarcr3r3r3r4rS�s

rSc@s&eZdZdZdZejdd�dd�ZdS)�RetryActionrr5N)rr1cCst|�|_dSr2)�floatr)r[rr3r3r4�__init__�szRetryAction.__init__)r@rMrNrTrUrd�
SupportsFloatrkr3r3r3r4ri�sri)�first�secondr1cCs|tur|S|Sr2)�_unset)rmrnr3r3r4�
_first_set�srpcsDeZdZdZddd��fdd�Zdd�d	d
�Zed�dd�Z�ZS)
�
RetryErrorz>Encapsulates the last attempt instance right before giving up.�FutureN)�last_attemptr1cs||_t��|�dSr2)rs�superrk)r[rs�r?r3r4rk�szRetryError.__init__z
t.NoReturnrVcCs|jjr|j���|�dSr2)rs�failed�resultrZr3r3r4�reraise�s
zRetryError.reraisecCs|jj�d|j�d�S)N�[�])r?r@rsrZr3r3r4rc�szRetryError.__str__)	r@rMrNrOrkrxrfrc�
__classcell__r3r3rur4rq�srqc@s^eZdZdZdd�dd�Zdd�dd	�Zejeje	eje	ejd
eje
d�dd
�ZdS)�AttemptManagerzManage attempt context.�RetryCallState��retry_statecCs
||_dSr2r~)r[rr3r3r4rk�szAttemptManager.__init__NrVcCsdSr2r3rZr3r3r4�	__enter__�szAttemptManager.__enter__�types.TracebackType)�exc_type�	exc_value�	tracebackr1cCs4t|t�r |j�|||f�dS|j�d�dSdS)NT)r<�
BaseExceptionr�
set_exception�
set_result)r[r�r�r�r3r3r4�__exit__�s

zAttemptManager.__exit__)r@rMrNrOrkr�rdrh�Typer��boolr�r3r3r3r4r|�s�r|c@s>eZdZeee�e�eedde	df
e
je
je
efgdfddee
jdgdfe
jdgdfe
je
jdgdfee
je	e
je
jdge
jfd�
dd�Zeeeeeeeeeef
e
je
je
je
efgdfefe
jdefe
jdefe
jeefe
je
jdgdfefe
je
jdgdfefe
je
je
jdgdfefe
jeefe
je
je	efe
je
je
jdge
jfefdd	�d
d�Zed�d
d�Zee
jee
jfd�dd��Zeed�dd�Zdd�dd�Zde
je e!e
jfd�dd�Z"e
j#e$ddfd�dd�Z%e&e
jde'fe
je
je'd�dd��Z(dS)�BaseRetryingNFr,r+r}�
r�stop�waitr5�before�after�before_sleeprx�retry_error_cls�retry_error_callbackcCsJ||_||_||_||_||_||_||_||_t�	�|_
|	|_|
|_dSr2)
rr�r�r5r�r�r�rx�	threading�local�_localr�r��r[rr�r�r5r�r�r�rxr�r�r3r3r4rk�s

zBaseRetrying.__init__)rr�r�r5r�r�r�rxr�r�r1c
Csn|jt||j�t||j�t||j�t||j�t||j�t||j�t||j�t||j	�t|	|j
�t|
|j�d�
S)z8Copy this object with some parameters changed if needed.r�)r?rprr�r�r5r�r�r�rxr�r�r�r3r3r4�copy�s









�zBaseRetrying.copyrVcCsLd|jj�dt|�d�d|j�d|j�d|j�d|j�d|j�d	|j�d
�S)N�<z
 object at 0x�xz (stop=z, wait=z, sleep=z, retry=z	, before=z, after=z)>)	r?r@�idr�r�rr5r�r�rZr3r3r4ras�������zBaseRetrying.__repr__cCs2z
|jjWSty,i|j_|jjYS0dS)aSReturn a dictionary of runtime statistics.

        This dictionary will be empty when the controller has never been
        ran. When it is running or has ran previously it should have (but
        may not) have useful and/or informational keys and values when
        running is underway and/or completed.

        .. warning:: The keys in this dictionary **should** be some what
                     stable (not changing), but there existence **may**
                     change between major releases as new statistics are
                     gathered or removed so before accessing keys ensure that
                     they actually exist and handle when they do not.

        .. note:: The values in this dictionary are local to the thread
                  running call (so if multiple threads share the same retrying
                  object - either directly or indirectly) they will each have
                  there own view of statistics they have collected (in the
                  future we may provide a way to aggregate the various
                  statistics from each thread).
        N)r��
statistics�AttributeErrorrZr3r3r4r�"s

zBaseRetrying.statisticsr9csTt���tjtjtjd���fdd��}tjtjtd���fdd�}�|_||_|S)z[Wrap a function for retrying.

        :param f: A function to wraps for retrying.
        )�args�kwr1cs��g|�Ri|��Sr2r3)r�r��r:r[r3r4�	wrapped_fDsz%BaseRetrying.wraps.<locals>.wrapped_f)r��kwargsr1cs�j|i|�����Sr2)r�rG)r�r�r�r3r4�
retry_withHsz&BaseRetrying.wraps.<locals>.retry_with)�	functoolsrGrd�Anyr-r5r�)r[r:r�r�r3r�r4rG>s zBaseRetrying.wrapscCs0|j��t��|jd<d|jd<d|jd<dS)N�
start_timer�attempt_numberr�idle_for)r��clear�time�	monotonicrZr3r3r4�beginPs

zBaseRetrying.begin)rr1cCs(|j}|dur(|jdur"|�|�t�S|jjo>t|j��t�}|sX|j|d�sX|��S|j	durl|�	|�|j
|jd<|j|d�r�|j
r�|�
|�S|�|�}|jr�|���||���|jr�|j|d�}nd}t|�|_|j|7_|jd|7<|jdd7<|jdu�r |�|�t|�S)Nr~Zdelay_since_first_attempt�r�r�r)�outcomer�rPrvr<�	exceptionrLr5rwr��seconds_since_startr�r�r�r�rxr�ri�next_actionr�r�rR)r[r�futZis_explicit_retryZ	retry_excrr3r3r4�iterVs8








zBaseRetrying.iterccsb|��t|ddid�}|j|d�}t|t�r<t|d�Vqt|t�r^|��|�|�qq^qdS)Nr3)r0r�r�r~)	r�r}r�r<rPr|rR�prepare_for_next_attemptr)r[r�dor3r3r4�__iter__{s

zBaseRetrying.__iter__.�r0r�r�r1cOsdSr2r3)r[r0r�r�r3r3r4�__call__�szBaseRetrying.__call__))r@rMrNrrr"rr&r(rqrd�Callable�Union�intrjrrhr�r�r�rkro�objectr�rfra�property�Dictr�r-rGr�rPrRr��	Generatorr|r�rr/r�r3r3r3r4r��sl���" �%r�c@s2eZdZdZejdefejejed�dd�ZdS)rFzRetrying controller..r�cOs�|��t||||d�}|j|d�}t|t�rnz||i|��}Wn ty`|�t���Yq�0|�	|�qt|t
�r�|��|�|�q|SqdS)N)�retry_objectr0r�r�r~)
r�r}r�r<rPr�r��sys�exc_infor�rRr�r)r[r0r�r�rr�rwr3r3r4r��s

zRetrying.__call__N)	r@rMrNrOrdr�r/r�r�r3r3r3r4rF�srFcsTeZdZdZedd��fdd�Zeed�dd��Ze	ee
jedd	�d
d��Z�Z
S)rrzDEncapsulates a (future or past) attempted call to a target function.N)r�r1cst���||_dSr2)rtrkr�)r[r�rur3r4rk�s
zFuture.__init__rVcCs|��duS)z8Return whether a exception is being held in this future.N)r�rZr3r3r4rv�sz
Future.failed)r��value�
has_exceptionr1cCs&||�}|r|�|�n
|�|�|S)zConstruct a new Future object.)r�r�)�clsr�r�r�r�r3r3r4�	construct�s

zFuture.construct)r@rMrNrOr�rkr�r�rv�classmethodrdr�r�r{r3r3rur4rr�srrc@s�eZdZdZeejeejejdd�dd�Z	e
ejed�dd��Zdd�d	d
�Z
ejdd�dd
�Zejejeedfdd�dd�Zdd�ZdS)r}z5State related to a single call wrapped with Retrying.N)r�r0r�r�r1cCsDt��|_||_||_||_||_d|_d|_d|_	d|_
d|_dS)Nrr�)r�r�r�r�r0r�r�r�r��outcome_timestampr�r�)r[r�r0r�r�r3r3r4rk�s
zRetryCallState.__init__rVcCs|jdurdS|j|jSr2)r�r�rZr3r3r4r��s
z"RetryCallState.seconds_since_startcCs$d|_d|_|jd7_d|_dS�Nr)r�r�r�r�rZr3r3r4r��sz'RetryCallState.prepare_for_next_attempt)�valr1cCs.t��}t|j�}|�|�|||_|_dSr2)r�r�rrr�r�r�r�)r[r��tsr�r3r3r4r��s

zRetryCallState.set_resultr�)r�r1cCs2t��}t|j�}|�|d�|||_|_dSr�)r�r�rrr�r�r�r�)r[r�r�r�r3r3r4r��s
zRetryCallState.set_exceptioncCs�|jdurd}n:|jjr:|j��}d|jj�d|�d�}nd|j����}tt|jd��}|jj}d|�dt	|��d|j
�d	|�d
|�d�S)Nznone yetzfailed (� r_z	returned �r�z: attempt #z; slept for z; last result: �>)r�rvr�r?r@rwrj�roundr�r�r�)r[rwr�ZsleptZclsnamer3r3r4ra�s

zRetryCallState.__repr__)r@rMrNrOr�rdrhr-r�rkr�rjr�r�r��Tupler�r�r�rar3r3r3r4r}�s�"r})rA)rE)Zr�r�r�r��typingrdr=�abcrrZ
concurrentr�inspectrr5rrr	r
rrr
rrrrrrZnaprrr�rrrrrrr�rrrr r!r"r#r$Zwait_full_jitterr�r%r&r�r'r(r�r)r*rB�
TYPE_CHECKING�typesr+r,�TypeVarr�r-r/�overloadr�r��	ExceptionrLr�Z	NO_RESULTrPrjrRrSrirorprqr|r�rFrrr}Zpip._vendor.tenacity._asynciorAZpip._vendor.tenacity.tornadowebrEr3r3r3r4�<module>s�
$,"-F
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`le69CR(!S2!P <0x<!1AQ "Raq02Br#SCTb ?Ζ"]mH5WR7k.ۛ!}Q~+yԏz|@T20S~Kek *zFf^2X*(@8r?CIuI|֓>^ExLgNUY+{.RѪ τV׸YTD I62'8Y27'\TP.6d&˦@Vqi|8-OΕ]ʔ U=TL8=;6c| !qfF3aů&~$l}'NWUs$Uk^SV:U# 6w++s&r+nڐ{@29 gL u"TÙM=6(^"7r}=6YݾlCuhquympǦ GjhsǜNlɻ}o7#S6aw4!OSrD57%|?x>L |/nD6?/8w#[)L7+6〼T ATg!%5MmZ/c-{1_Je"|^$'O&ޱմTrb$w)R$& N1EtdU3Uȉ1pM"N*(DNyd96.(jQ)X 5cQɎMyW?Q*!R>6=7)Xj5`J]e8%t!+'!1Q5 !1 AQaqё#2"0BRb?Gt^## .llQT $v,,m㵜5ubV =sY+@d{N! dnO<.-B;_wJt6;QJd.Qc%p{ 1,sNDdFHI0ГoXшe黅XۢF:)[FGXƹ/w_cMeD,ʡcc.WDtA$j@:) -# u c1<@ۗ9F)KJ-hpP]_x[qBlbpʖw q"LFGdƶ*s+ډ_Zc"?%t[IP 6J]#=ɺVvvCGsGh1 >)6|ey?Lӣm,4GWUi`]uJVoVDG< SB6ϏQ@ TiUlyOU0kfV~~}SZ@*WUUi##; s/[=!7}"WN]'(L! ~y5g9T̅JkbM' +s:S +B)v@Mj e Cf jE 0Y\QnzG1д~Wo{T9?`Rmyhsy3!HAD]mc1~2LSu7xT;j$`}4->L#vzŏILS ֭T{rjGKC;bpU=-`BsK.SFw4Mq]ZdHS0)tLg