o
    Āg
                     @   s   d dl Z d dlZejrd dlZd dlmZ G dd de jZG dd deZG dd deZ	G d	d
 d
eZ
e
 ZG dd deZG dd deZG dd deZdS )    N)RetryCallStatec                   @   s<   e Zd ZdZejdddefddZdd	d
ZdddZ	dS )	stop_basez(Abstract base class for stop strategies.retry_stater   returnc                 C   s   d S N selfr   r   r   M/var/www/html/myenv/lib/python3.10/site-packages/pip/_vendor/tenacity/stop.py__call__   s   zstop_base.__call__otherstop_allc                 C   
   t | |S r   )r   r	   r   r   r   r
   __and__       
zstop_base.__and__stop_anyc                 C   r   r   )r   r   r   r   r
   __or__#   r   zstop_base.__or__N)r   r   r   r   )r   r   r   r   )
__name__
__module____qualname____doc__abcabstractmethodboolr   r   r   r   r   r   r
   r      s    
r   c                   @   4   e Zd ZdZdeddfddZdddefd	d
ZdS )r   z+Stop if any of the stop condition is valid.stopsr   Nc                 G   
   || _ d S r   r   r	   r   r   r   r
   __init__*   r   zstop_any.__init__r   r   c                       t  fdd| jD S )Nc                 3       | ]}| V  qd S r   r   .0xr   r   r
   	<genexpr>.       z$stop_any.__call__.<locals>.<genexpr>)anyr   r   r   r&   r
   r   -      zstop_any.__call__r   r   r   r   r   r    r   r   r   r   r   r
   r   '       r   c                   @   r   )r   z*Stop if all the stop conditions are valid.r   r   Nc                 G   r   r   r   r   r   r   r
   r    4   r   zstop_all.__init__r   r   c                    r!   )Nc                 3   r"   r   r   r#   r&   r   r
   r'   8   r(   z$stop_all.__call__.<locals>.<genexpr>)allr   r   r   r&   r
   r   7   r*   zstop_all.__call__r+   r   r   r   r
   r   1   r,   r   c                   @   s"   e Zd ZdZdddefddZdS )_stop_neverzNever stop.r   r   r   c                 C   s   dS )NFr   r   r   r   r
   r   >   s   z_stop_never.__call__N)r   r   r   r   r   r   r   r   r   r
   r.   ;   s    r.   c                   @   s,   e Zd ZdZdddZdd	defd
dZdS )stop_when_event_setz!Stop when the given event is set.eventthreading.Eventr   Nc                 C   r   r   )r0   )r	   r0   r   r   r
   r    H   r   zstop_when_event_set.__init__r   r   c                 C   s
   | j  S r   )r0   is_setr   r   r   r
   r   K   r   zstop_when_event_set.__call__)r0   r1   r   N)r   r   r   r   r    r   r   r   r   r   r
   r/   E   s    
r/   c                   @   r   )stop_after_attemptz.Stop when the previous attempt >= max_attempt.max_attempt_numberr   Nc                 C   r   r   )r4   )r	   r4   r   r   r
   r    R   r   zstop_after_attempt.__init__r   r   c                 C      |j | jkS r   )attempt_numberr4   r   r   r   r
   r   U      zstop_after_attempt.__call__)r   r   r   r   intr    r   r   r   r   r   r
   r3   O   r,   r3   c                   @   r   )stop_after_delayz3Stop when the time from the first attempt >= limit.	max_delayr   Nc                 C   r   r   )r:   )r	   r:   r   r   r
   r    \   r   zstop_after_delay.__init__r   r   c                 C   r5   r   )seconds_since_startr:   r   r   r   r
   r   _   r7   zstop_after_delay.__call__)r   r   r   r   floatr    r   r   r   r   r   r
   r9   Y   r,   r9   )r   typingTYPE_CHECKING	threadingpip._vendor.tenacityr   ABCr   r   r   r.   
stop_neverr/   r3   r9   r   r   r   r
   <module>   s   



