
    /h
                        d dl Z d dlZej        r
d dlZd dlmZ  G d de j                  Z G d de          Z G d de          Z	 G d	 d
e          Z
 e
            Z G d de          Z G d de          Z G d de          ZdS )    N)RetryCallStatec                   L    e Zd ZdZej        dddefd            ZddZdd
Z	dS )	stop_basez(Abstract base class for stop strategies.retry_stater   returnc                     d S N selfr   s     L/var/www/html/venv/lib/python3.11/site-packages/pip/_vendor/tenacity/stop.py__call__zstop_base.__call__   s        otherstop_allc                 "    t          | |          S r	   )r   r   r   s     r   __and__zstop_base.__and__        e$$$r   stop_anyc                 "    t          | |          S r	   )r   r   s     r   __or__zstop_base.__or__#   r   r   N)r   r   r   r   )r   r   r   r   )
__name__
__module____qualname____doc__abcabstractmethodboolr   r   r   r
   r   r   r   r      ss        22$4     % % % %% % % % % %r   r   c                   2    e Zd ZdZdeddfdZdddefdZdS )	r   z+Stop if any of the stop condition is valid.stopsr   Nc                     || _         d S r	   r!   r   r!   s     r   __init__zstop_any.__init__*       


r   r   r   c                 D    t          fd| j        D                       S )Nc              3   .   K   | ]} |          V  d S r	   r
   .0xr   s     r   	<genexpr>z$stop_any.__call__.<locals>.<genexpr>.   +      66a11[>>666666r   )anyr!   r   s    `r   r   zstop_any.__call__-   (    66664:666666r   r   r   r   r   r   r%   r   r   r
   r   r   r   r   '   s_        55y T    7$4 7 7 7 7 7 7 7r   r   c                   2    e Zd ZdZdeddfdZdddefdZdS )	r   z*Stop if all the stop conditions are valid.r!   r   Nc                     || _         d S r	   r#   r$   s     r   r%   zstop_all.__init__4   r&   r   r   r   c                 D    t          fd| j        D                       S )Nc              3   .   K   | ]} |          V  d S r	   r
   r)   s     r   r,   z$stop_all.__call__.<locals>.<genexpr>8   r-   r   )allr!   r   s    `r   r   zstop_all.__call__7   r/   r   r0   r
   r   r   r   r   1   s_        44y T    7$4 7 7 7 7 7 7 7r   r   c                   "    e Zd ZdZdddefdZdS )_stop_neverzNever stop.r   r   r   c                     dS )NFr
   r   s     r   r   z_stop_never.__call__>   s    ur   N)r   r   r   r   r   r   r
   r   r   r7   r7   ;   s=        $4       r   r7   c                   *    e Zd ZdZd
dZdddefd	ZdS )stop_when_event_setz!Stop when the given event is set.eventthreading.Eventr   Nc                     || _         d S r	   )r;   )r   r;   s     r   r%   zstop_when_event_set.__init__H   r&   r   r   r   c                 4    | j                                         S r	   )r;   is_setr   s     r   r   zstop_when_event_set.__call__K   s    z  """r   )r;   r<   r   N)r   r   r   r   r%   r   r   r
   r   r   r:   r:   E   sQ        ++   #$4 # # # # # # #r   r:   c                   2    e Zd ZdZdeddfdZdddefdZdS )	stop_after_attemptz.Stop when the previous attempt >= max_attempt.max_attempt_numberr   Nc                     || _         d S r	   )rB   )r   rB   s     r   r%   zstop_after_attempt.__init__R   s    "4r   r   r   c                 "    |j         | j        k    S r	   )attempt_numberrB   r   s     r   r   zstop_after_attempt.__call__U   s    )T-DDDr   )r   r   r   r   intr%   r   r   r
   r   r   rA   rA   O   sg        8853 54 5 5 5 5E$4 E E E E E E Er   rA   c                   2    e Zd ZdZdeddfdZdddefdZdS )	stop_after_delayz3Stop when the time from the first attempt >= limit.	max_delayr   Nc                     || _         d S r	   )rI   )r   rI   s     r   r%   zstop_after_delay.__init__\   s    "r   r   r   c                 "    |j         | j        k    S r	   )seconds_since_startrI   r   s     r   r   zstop_after_delay.__call___   s    .$.@@r   )r   r   r   r   floatr%   r   r   r
   r   r   rH   rH   Y   sg        ==#% #D # # # #A$4 A A A A A A Ar   rH   )r   typingTYPE_CHECKING	threadingpip._vendor.tenacityr   ABCr   r   r   r7   
stop_neverr:   rA   rH   r
   r   r   <module>rT      s    


 	 4333333% % % % % % % %7 7 7 7 7y 7 7 77 7 7 7 7y 7 7 7    )    []]
# # # # #) # # #E E E E E E E EA A A A Ay A A A A Ar   