HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_vendor/tenacity/__pycache__/wait.cpython-37.pyc
B

L��gX�@sddlZddlZddlZddlmZejr6ddlmZGdd�dej�Zej	eej
dgej	eefffZ
Gdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)�N)�_utils)�RetryCallStatec@sLeZdZdZejded�dd��Zddd�dd	�Zde	j
d
d�dd�Zd
S)�	wait_basez(Abstract base class for wait strategies.r)�retry_state�returncCsdS)N�)�selfrrr�=/tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/tenacity/wait.py�__call__szwait_base.__call__�wait_combine)�otherrcCs
t||�S)N)r)rrrrr	�__add__"szwait_base.__add__)rrcCs|dkr|S|�|�S)Nr)r
)rrrrr	�__radd__%szwait_base.__radd__N)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethod�floatr
r
�typing�Unionrrrrr	rs
rrc@s2eZdZdZejdd�dd�Zded�dd	�ZdS)
�
wait_fixedzCWait strategy that waits a fixed amount of time between each retry.N)�waitrcCst�|�|_dS)N)r�
to_secondsr)rrrrr	�__init__2szwait_fixed.__init__r)rrcCs|jS)N)r)rrrrr	r
5szwait_fixed.__call__)	rrrrr�time_unit_typerrr
rrrr	r/srcs&eZdZdZdd��fdd�Z�ZS)�	wait_nonez7Wait strategy that doesn't wait at all before retrying.N)rcst��d�dS)Nr)�superr)r)�	__class__rr	r<szwait_none.__init__)rrrrr�
__classcell__rr)rr	r9src@s8eZdZdZdejejdd�dd�Zded	�d
d�ZdS)
�wait_randomzAWait strategy that waits a random amount of time between min/max.r�N)�min�maxrcCst�|�|_t�|�|_dS)N)rr�wait_random_min�wait_random_max)rr#r$rrr	rCszwait_random.__init__r)rrcCs|jt��|j|jS)N)r%�randomr&)rrrrr	r
Gszwait_random.__call__)rr")	rrrrrrrrr
rrrr	r!@sr!c@s0eZdZdZedd�dd�Zded�dd	�ZdS)
rz#Combine several waiting strategies.N)�
strategiesrcGs
||_dS)N)�
wait_funcs)rr(rrr	rNszwait_combine.__init__r)rrcst�fdd�|jD��S)Nc3s|]}|�d�VqdS))rNr)�.0�x)rrr	�	<genexpr>Rsz(wait_combine.__call__.<locals>.<genexpr>)�sumr))rrr)rr	r
Qszwait_combine.__call__)rrrrrrrr
rrrr	rKsrc@s0eZdZdZedd�dd�Zded�dd	�ZdS)
�
wait_chaina�Chain two or more waiting strategies.

    If all strategies are exhausted, the very last strategy is used
    thereafter.

    For example::

        @retry(wait=wait_chain(*[wait_fixed(1) for i in range(3)] +
                               [wait_fixed(2) for j in range(5)] +
                               [wait_fixed(5) for k in range(4)))
        def wait_chained():
            print("Wait 1s for 3 attempts, 2s for 5 attempts and 5s
                   thereafter.")
    N)r(rcGs
||_dS)N)r()rr(rrr	reszwait_chain.__init__r)rrcCs0tt|jd�t|j��}|j|d}||d�S)Nr")r)r#r$�attempt_number�lenr()rrZwait_func_no�	wait_funcrrr	r
hszwait_chain.__call__)rrrrrrrr
rrrr	r.Usr.c@sDeZdZdZddejfejejejdd�dd�Zded	�d
d�Z	dS)�wait_incrementingz�Wait an incremental amount of time after each attempt.

    Starting at a starting value and incrementing by a value for each attempt
    (and restricting the upper limit to some maximum value).
    r�dN)�start�	incrementr$rcCs(t�|�|_t�|�|_t�|�|_dS)N)rrr4r5r$)rr4r5r$rrr	ruszwait_incrementing.__init__r)rrcCs(|j|j|jd}tdt||j��S)Nr"r)r4r5r/r$r#)rr�resultrrr	r
szwait_incrementing.__call__)
rrrrr�MAX_WAITrrrr
rrrr	r2nsr2c@sZeZdZdZdejddfejee	fej
ejee	fej
dd�dd�Zd	e	d
�dd�ZdS)
�wait_exponentialaWait strategy that applies exponential backoff.

    It allows for a customized multiplier and an ability to restrict the
    upper and lower limits to some maximum and minimum value.

    The intervals are fixed (i.e. there is no jitter), so this strategy is
    suitable for balancing retries against latency when a required resource is
    unavailable for an unknown duration, but *not* suitable for resolving
    contention between multiple processes for a shared resource. Use
    wait_random_exponential for the latter case.
    r"�rN)�
multiplierr$�exp_baser#rcCs(||_t�|�|_t�|�|_||_dS)N)r:rrr#r$r;)rr:r$r;r#rrr	r�szwait_exponential.__init__r)rrcCsPy|j|jd}|j|}Wntk
r4|jSXttd|j�t||j��S)Nr"r)r;r/r:�
OverflowErrorr$r#)rr�expr6rrr	r
�szwait_exponential.__call__)
rrrrrr7rr�intrrrr
rrrr	r8�s$r8cs(eZdZdZded��fdd�Z�ZS)�wait_random_exponentialaRandom wait with exponentially widening window.

    An exponential backoff strategy used to mediate contention between multiple
    uncoordinated processes for a shared resource in distributed systems. This
    is the sense in which "exponential backoff" is meant in e.g. Ethernet
    networking, and corresponds to the "Full Jitter" algorithm described in
    this blog post:

    https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

    Each retry occurs at a random time in a geometrically expanding interval.
    It allows for a custom multiplier and an ability to restrict the upper
    limit of the random interval to some maximum value.

    Example::

        wait_random_exponential(multiplier=0.5,  # initial window 0.5s
                                max=60)          # max 60s timeout

    When waiting for an unavailable resource to become available again, as
    opposed to trying to resolve contention for a shared resource, the
    wait_exponential strategy (which uses a fixed interval) may be preferable.

    r)rrcst�j|d�}t�d|�S)N)rr)rr
r'�uniform)rr�high)rrr	r
�sz wait_random_exponential.__call__)rrrrrr
r rr)rr	r?�sr?c@sBeZdZdZdejddfeeeedd�dd�Zded	�d
d�ZdS)�wait_exponential_jittera`Wait strategy that applies exponential backoff and jitter.

    It allows for a customized initial wait, maximum wait and jitter.

    This implements the strategy described here:
    https://cloud.google.com/storage/docs/retry-strategy

    The wait time is min(initial * 2**n + random.uniform(0, jitter), maximum)
    where n is the retry count.
    r"r9N)�initialr$r;�jitterrcCs||_||_||_||_dS)N)rCr$r;rD)rrCr$r;rDrrr	r�sz wait_exponential_jitter.__init__r)rrcCs^t�d|j�}y"|j|jd}|j||}Wntk
rJ|j}YnXtdt||j��S)Nrr")	r'r@rDr;r/rCr<r$r#)rrrDr=r6rrr	r
�sz wait_exponential_jitter.__call__)	rrrrrr7rrr
rrrr	rB�s
rB)rr'rZpip._vendor.tenacityr�
TYPE_CHECKINGr�ABCrr�Callablerr>Z	WaitBaseTrrr!rr.r2r8r?rBrrrr	�<module>s $

"