Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
stop.cpython-313.pyc39 linesDownload Raw Back to __pycache__
1�

2r�j��j�SSKrSSKrSSKJr \R(a3SSKrSSKJr "SS\R5r\R\\RS/\44r"SS\5r
"S	S4\5r"SS\5r\"5r"S
S\5r"SS\5r"SS\5r"SS\5rg)�N)�_utils)�RetryCallStatec�\�\rSrSrSr\RSSS\4Sj5rSSjr	SSjr5S	rg6)
�	stop_base�z(Abstract base class for stop strategies.�retry_stater�returnc��g�N���selfrs  �SD:\code\apps\devtools\python\user_packages\Python313\site-packages\tenacity/stop.py�__call__�stop_base.__call__s���c��[X5$r)�stop_all�r�others  r�__and__�stop_base.__and__"�
����$�$rc��[X5$r)�stop_anyrs  r�__or__�stop_base.__or__%rrrN)rrr	r)rrr	r)�__name__�7__module__�__qualname__�__firstlineno__�__doc__�abc�abstractmethod�boolrrr�__static_attributes__rrrrrs6��2����
�$4�
��
��
�%�%rrrc�<�\rSrSrSrS\SS4SjrSSS\4S	jrS8r	g)r�,z+Stop if any of the stop condition is valid.�stopsr	Nc��Xlgr�r)�rr)s  r�__init__�stop_any.__init__/����9rrrc�B^�[U4SjUR55$)Nc3�2># �UHo"T5v� M g7frr��.0�xrs  �r�	<genexpr>�$stop_any.__call__.<locals>.<genexpr>3�����6�:�a�1�[�>�>�:���)�anyr)r
s `rr�stop_any.__call__2�����6�4�:�:�6�6�6rr+�10rrr r!r"rr-r%rr&rrrrr,s,��5��y��T��7�$4�7��7rrc�<�\rSrSrSrS\SS4SjrSSS\4S	jrS11r	g)r�6z*Stop if all the stop conditions are valid.r)r	Nc��Xlgrr+r,s  rr-�stop_all.__init__9r/rrrc�B^�[U4SjUR55$)Nc3�2># �UHo"T5v� M g7frrr2s  �rr5�$stop_all.__call__.<locals>.<genexpr>=r7r8)�allr)r
s `rr�stop_all.__call__<r;rr+r<rrrrr6s,��4��y��T��7�$4�7��7rrc�*�\rSrSrSrSSS\4SjrSrg)	�_stop_never�@zNever stop.rrr	c��g)NFrr
s  rr�_stop_never.__call__Cs��rrN)rrr r!r"r%rr&rrrrGrG@s����$4���rrGc�4�\rSrSrSrS12SjrSSS\4SjrS	rg)�stop_when_event_set�Jz!Stop when the given event is set.r	Nc��Xlgr��event)rrPs  rr-�stop_when_event_set.__init__Mr/rrrc�6�URR5$r)rP�is_setr
s  rr�stop_when_event_set.__call__Ps���z�z� � �"�"rrO)rPzthreading.Eventr	N)	rrr r!r"r-r%rr&rrrrLrLJs��+��#�$4�#��#rrLc�<�\rSrSrSrS\SS4SjrSSS\4S	jrS13r	g)�stop_after_attempt�Tz.Stop when the previous attempt >= max_attempt.�max_attempt_numberr	Nc��Xlgr�rX)rrXs  rr-�stop_after_attempt.__init__Ws��"4�rrrc�4�URUR:�$r)�attempt_numberrXr
s  rr�stop_after_attempt.__call__Zs���)�)�T�-D�-D�D�DrrZ)14rrr r!r"�intr-r%rr&rrrrVrVTs/��8�5�3�5�4�5�E�$4�E��ErrVc�P�\rSrSrSrS\RSS4SjrSSS\4S	jr	S15r16g)�stop_after_delay�^a?17Stop when the time from the first attempt >= limit.18 19Note: `max_delay` will be exceeded, so when used with a `wait`, the actual total delay will be greater20than `max_delay` by some of the final sleep period before `max_delay` is exceeded.21 22If you need stricter timing with waits, consider `stop_before_delay` instead.23�	max_delayr	Nc�:�[R"U5Ulgr�r�24to_secondsrc�rrcs  rr-�stop_after_delay.__init__h����*�*�9�5��rrrc�d�URc[S5eURUR:�$�Nz4__call__() called but seconds_since_start is not set)�seconds_since_start�RuntimeErrorrcr
s  rr�stop_after_delay.__call__ks/���*�*�2��U�V�V��.�.�$�.�.�@�@r�rc�rrr r!r"r�time_unit_typer-r%rr&rrrrara^s7���6�&�"7�"7�6�D�6�A�$4�A��Arrac�P�\rSrSrSrS\RSS4SjrSSS\4S	jr	S25r26g)�stop_before_delay�qz�27Stop right before the next attempt would take place after the time from the first attempt >= limit.28 29Most useful when you are using with a `wait` function like wait_random_exponential, but need to make30sure that the max_delay is not exceeded.31rcr	Nc�:�[R"U5Ulgrrergs  rr-�stop_before_delay.__init__yrirrrc�~�URc[S5eURUR-UR:�$rk)rlrm�upcoming_sleeprcr
s  rr�stop_before_delay.__call__|s?���*�*�2��U�V�V��+�+�k�.H�.H�H��~�~�
�	32rrorprrrrsrsqs4���6�&�"7�"7�6�D�6�33�$4�34��35rrs)r#�typing�tenacityr�
TYPE_CHECKING�	threadingr�ABCr�Union�Callabler%�	StopBaseTrrrG�36stop_neverrLrVrarsrrr�<module>r�s��� �
��	����'�%����%�
�L�L��F�O�O�5E�4F��4L�$M�M�N�	�7�y�7�7�y�7��)���]�37�#�)�#�E��E�A�y�A�&38�	�39r
codekingpro/portable-devtools · Team Ai