� ��^iQG� �>�ddlZddlZddlZddlZddlZddlZddlmZm Z ddl m Z ddl m Z ddlmZddlmZddlmZdd lmZdd lmZdd lmZdd 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:rddl;Z;dd)l&md+ej?�,��Z@ej>d-��ZAejBd.e@d/e@fd0���ZejBd1ejCd2ejCd/ej?e@ge@ffd3���Zd1ejCd2ejCd/ejDe@ej?e@ge@fffd4�ZGd5�d6eE��ZFeG��ZHGd7�d8��ZIGd9�d:eJ��ZKGd;�d<��ZLGd=�d>eL��ZMeG��ZNd?ejDejCeGfd@ejCd/ejCfdA�ZOGdB�dCeE��ZPGdD�dE��ZQGdF�dGe��ZRGdH�dIeR��ZSGdJ�dKe jT��ZTGdL�dM��ZUddNlVmWZWe9rddOlXmYZYdSdS)P�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�returnc��dS�N�)r1s ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/tenacity/__init__.py�retryr7a����D��dargs�dkwc��dSr4r5)r:r;s r6r7r7fr8r9c����t���dkr2t�d��rt���d��Sdtdtf��fd� }|S)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�fr2c���t|t��r/tjd|jj�d|jj�d���t |��r t�i���}nYtrFttj d��r,tj � |��r t�i���}n t�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>�rr:r;s ��r6�wrapzretry..wrapvs�����!�Z�(�(� �� �n�� �0D�n�n�PQ�P[�Pd�n�n�n����#�1�%�%� ,�$1�5�$@�C�$@�$@���� ,�W�W�[�2I�J�J� ,�w�{�Op�Op�qr�Os�Os� ,�#�U�2�c�2�2����e�+�s�+�+���7�7�1�:�:� r9)�len�callabler7r.)r:r;rNs`` r6r7r7ksu���� �5�z�z�Q���8�E�!�H�-�-���u�w�w�u�Q�x� � � � �I� �)� � � � � � � �� r9c��eZdZdZdS)�TryAgainz/Always retry the executed function when raised.N)rE� __module__� __qualname__�__doc__r5r9r6rRrR�s������9�9�9�9r9rRc��eZdZdS)� DoAttemptN�rErSrTr5r9r6rWrW���������Dr9rWc��eZdZdS)�DoSleepNrXr5r9r6r[r[�rYr9r[c�t�eZdZUdZdZejeed<dZ ej eed<defd�Z defd�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 r5� REPR_FIELDSN�NAMEr2c�t��d��fd��jD����}�jj�d|�d�S)Nz, c3�B�K�|]}|�dt�|����V��dS)�=N)�getattr)�.0�field�selfs �r6� z&BaseAction.__repr__..�s;�����`�`�e��A�A���u�)=�)=�A�A�`�`�`�`�`�`r9�(�))�joinr^rDrE)rf� state_strs` r6�__repr__zBaseAction.__repr__�sH����I�I�`�`�`�`�t�O_�`�`�`�`�`� ��.�)�8�8�I�8�8�8�8r9c� �t|��Sr4)�repr�rfs r6�__str__zBaseAction.__str__�s���D�z�z�r9) rErSrTrUr^�t�Sequence�str�__annotations__r_�Optionalrlrpr5r9r6r]r]�s����������$&�K���C��%�%�%� �D�!�*�S�/� � � �9�#�9�9�9�9��������r9r]c�0�eZdZdZdZdejddfd�ZdS)� RetryActionrr7rr2Nc�.�t|��|_dSr4)�floatr)rfrs r6�__init__zRetryAction.__init__�s���5�\�\�� � � r9)rErSrTr^r_rq� SupportsFloatrzr5r9r6rwrw�sB�������K� �D�"�a�o�"�$�"�"�"�"�"�"r9rw�first�secondc��|tur|n|Sr4)�_unset)r|r}s r6� _first_setr��s���f�_�_�6�6�%�/r9c�8��eZdZdZd �fd� Zd d�Zdefd �Z�xZS) � RetryErrorz>Encapsulates the last attempt instance right before giving up.� last_attempt�Futurer2Nc�X��||_t���|��dSr4)r��superrz)rfr�rDs �r6rzzRetryError.__init__�s)���(��� ������&�&�&�&�&r9� t.NoReturnc�P�|jjr|j����|�r4)r��failed�resultros r6�reraisezRetryError.reraise�s*�� � � #� -��#�*�*�,�,� ,�� r9c�0�|jj�d|j�d�S)N�[�])rDrEr�ros r6rpzRetryError.__str__�s!���.�)�@�@�D�,=�@�@�@�@r9)r�r�r2N)r2r�) rErSrTrUrzr�rsrp� __classcell__�rDs@r6r�r��s{�������H�H�'�'�'�'�'�'����� A��A�A�A�A�A�A�A�Ar9r�c ��eZdZdZd d�Zdd�Zdejeje d eje d ejd deje fd �Z dS)�AttemptManagerzManage attempt context.� retry_state�RetryCallStatec��||_dSr4�r�)rfr�s r6rzzAttemptManager.__init__�s��&����r9r2Nc��dSr4r5ros r6� __enter__zAttemptManager.__enter__�s�� �r9�exc_type� exc_value� traceback�types.TracebackTypec��t|t��r|j�|||f��dS|j�d��dS)NT)rA� BaseExceptionr�� set_exception� set_result)rfr�r�r�s r6�__exit__zAttemptManager.__exit__�sW�� �i�� /� /� � � � *� *�H�i��+K� L� L� L��4� � � '� '�� -� -� -��4r9)r�r��r2N) rErSrTrUrzr�rqru�Typer��boolr�r5r9r6r�r��s�������!�!�'�'�'�'� � � � � ��*�Q�V�M�2�3� ��:�m�,� ��:�3�4� � ��D� � � � � � � r9r�c��eZdZeee��e��eedde df de j e j e efgdfddddded e j d gdfd e j d gdfd e je j d gdfd ede je de je j d ge jffd�Zeeeeeeeeeef de j e j e j e efgdfefde j defde j defde j eefd e j e j d gdfefd e j e j d gdfefd e j e je j d gdfefd e j eefde j e je efde j e je j d ge jfefddfd�Zdefd�Zede jee jffd���Zdedefd�Zd d�Zdd de j e e!e jffd�Z"de j#e$ddffd�Z%e&de j de'fde jde jde'fd���Z(dS)!� BaseRetryingNFr�stopr-�waitr,r7�beforer��after� before_sleepr��retry_error_cls�retry_error_callbackc ���||_||_||_||_||_||_||_||_tj ��|_ | |_ | |_ dSr4) rr�r�r7r�r�r�r�� threading�local�_localr�r�� rfrr�r�r7r�r�r�r�r�r�s r6rzzBaseRetrying.__init__�sb���� ��� ��� ��� ��� ��� �(����� ��o�'�'�� �.���$8��!�!�!r9r2c ��|�t||j��t||j��t||j��t||j��t||j��t||j��t||j��t||j ��t| |j ��t| |j ���� � S)z8Copy this object with some parameters changed if needed.) rr�r�r7r�r�r�r�r�r�) rDr�rr�r�r7r�r�r�r�r�r�r�s r6�copyzBaseRetrying.copy�s����~�~��U�D�J�/�/��D�$�)�,�,��D�$�)�,�,��U�D�J�/�/��f�d�k�2�2��U�D�J�/�/�#�L�$�2C�D�D��w�� �5�5�&���8L�M�M�!+�,@�$�B[�!\�!\��  �  � r9c��d|jj�dt|��d�d|j�d|j�d|j�d|j�d|j�d |j�d �S) N�) rDrE�idr�r�rr7r�r�ros r6rlzBaseRetrying.__repr__s��� $���'� $� $�b��h�h� D� $� $��I� $� $��I� $� $��Z� $� $��Z�  $� $� �k�  $� $� �Z�  $� $� $� r9c�l� |jjS#t$ri|j_|jjcYSwxYw)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). )r�� statistics�AttributeErrorros r6r�zBaseRetrying.statistics"sH��, *��;�)� )��� *� *� *�%'�D�K� "��;�)� )� )� )� *���s � �"3�3r>c�����tj���dtjdtjdtjf��fd� ��}dtjdtjdtf��fd� }�|_||_|S)z[Wrap a function for retrying. :param f: A function to wraps for retrying. �args�kwr2c�����g|�Ri|��Sr4r5)r�r�r>rfs ��r6� wrapped_fz%BaseRetrying.wraps..wrapped_fDs#����4��'�D�'�'�'�B�'�'� 'r9�kwargsc�D���j|i|������Sr4)r�rL)r�r�r>rfs ��r6� retry_withz&BaseRetrying.wraps..retry_withHs(����4�9�d�-�f�-�-�3�3�A�6�6� 6r9)� functoolsrLrq�Anyr.r7r�)rfr>r�r�s`` r6rLzBaseRetrying.wraps>s����� ��� � � (�Q�U� (�!�%� (�A�E� (� (� (� (� (� (� � � (� 7�a�e� 7�q�u� 7�� 7� 7� 7� 7� 7� 7� 7�� ��)� ���r9c��|j���tj��|jd<d|jd<d|jd<dS)N� start_timer�attempt_numberr�idle_for)r��clear�time� monotonicros r6�beginzBaseRetrying.beginPsI�� �������(,��(8�(8��� �%�,-���(�)�&'��� �#�#�#r9r�c��|j}|�*|j�|�|��t��S|jjo+t |j���t ��}|s*|�|���s|���S|j �|� |��|j |j d<|� |���ra|j r|� |��S|�|��}|jr|����||����|jr|�|���}nd}t#|��|_|xj|z c_|j dxx|z cc<|j dxxdz cc<|j�|�|��t+|��S)Nr��delay_since_first_attempt�r�r�r)�outcomer�rWr�rA� exceptionrRr7r�r��seconds_since_startr�r�r�r�r�r�rw� next_actionr�r�r[)rfr��fut�is_explicit_retry� retry_excrs r6�iterzBaseRetrying.iterVs����!�� �;��{�&�� � �K�(�(�(��;�;� �'�/�6�p�:�k�FY�Fc�Fc�Fe�Fe�go�;p�;p��!� �T�Z�Z�K�Z�%H�%H� ��:�:�<�<� � �:� !� �J�J�{� #� #� #�7B�7V���3�4� �9�9��9� -� -� 1��(� >��0�0��=�=�=��,�,�S�1�1�I��|� *��'�'�)�)�)������� 0� �9� ��I�I�+�I�6�6�E�E��E�"-�e�"4�"4� ������%��� �� �#�#�#�u�,�#�#�#� ��(�)�)�)�Q�.�)�)�)� � � (� � � �k� *� *� *��u�~�~�r9c#�VK�|���t|ddi���} |�|���}t|t��rt |���V�nAt|t ��r*|���|�|��ndS��)Nr5)r1r�r�Tr�) r�r�r�rArWr�r[�prepare_for_next_attemptr)rfr��dos r6�__iter__zBaseRetrying.__iter__{s����� � � � � � �$�T�d��B�G�G�G� � ����{��3�3�B��"�i�(�(� �$��=�=�=�=�=�=�=��B��(�(� ��4�4�6�6�6�� � �2������� r9r1.r�r�c��dSr4r5)rfr1r�r�s r6�__call__zBaseRetrying.__call__�s�� �r9r�))rErSrTrrr#r r'r)r�rq�Callable�Union�intryrrur�r�r�rzr�objectr�rsrl�property�Dictr�r.rLr�rWr[r�� Generatorr�r�rr0r�r5r9r6r�r��s�������:?�&�%�I�K�K�3�3�5�5�7E�6C�IM��.8�RV�9�9��z�1�7�3��:�.�/��5�6�9��9�� 9� � 9� � �,�-�t�3�4� 9��z�+�,�d�2�3�9��j���-=�,>��,D�!E�F�9��9��� �+�9� �j���5E�4F���4M�)N�O�9�9�9�9�6KQ�-3�-3�-3�HN�GM�Z`�)/�?E�ci� � ��w�q�z�1�7�3��:�#6�"7��"=�>��F�G� ��g�k�6�)�*� ��g�k�6�)�*�  � �w�z�6�)�*�  � ��� �$4�#5�t�#;�<�f�D�E�  ��w�q�z�#3�"4�d�":�;�V�C�D� ��g�a�j���5E�4F��4L�)M�N�PV�V�W� ����v��&� ����� �!3�V�!;�<� � �g�a�j���=M��>�>��-�-�c�l�n�n�=�=�=�=�=�>�����B��(�(� ��4�4�6�6�6�� � �2������ � s�A3�30B&�%B&N) rErSrTrUrqr�r0r�r�r5r9r6rKrK�sZ���������1�:�c�8�m�4��Q�U��a�e��X`������r9rKc �z��eZdZdZdeddf�fd� Zedefd���Ze dede j deddfd ���Z �xZ S) r�zDEncapsulates a (future or past) attempted call to a target function.r�r2Nc�V��t�����||_dSr4)r�rzr�)rfr�rDs �r6rzzFuture.__init__�s'��� ��������,����r9c�.�|���duS)z8Return whether a exception is being held in this future.N)r�ros r6r�z Future.failed�s���~�~���t�+�+r9�value� has_exceptionc�v�||��}|r|�|��n|�|��|S)zConstruct a new Future object.)r�r�)�clsr�r�r�r�s r6� constructzFuture.construct�sI���c�.�!�!�� � "� � � �e� $� $� $� $� �N�N�5� !� !� !�� r9)rErSrTrUr�rzr�r�r�� classmethodrqr�r�r�r�s@r6r�r��s��������N�N�-�s�-�t�-�-�-�-�-�-��,��,�,�,��X�,���s��1�5����RZ�����[�����r9r�c ���eZdZdZdedejedejdejddf d�Z e deje fd ���Z dd �Z d ejddfd �Zd ejejeedfddfd�Zd�ZdS)r�z5State related to a single call wrapped with Retrying.r�r1r�r�r2Nc��tj��|_||_||_||_||_d|_d|_d|_ d|_ d|_ dS)Nrr�) r�r�r�r�r1r�r�r�r��outcome_timestampr�r�)rfr�r1r�r�s r6rzzRetryCallState.__init__�s^���.�*�*���(�������� ��� �$%���+/�� �48���"�� �48����r9c�2�|j�dS|j|jz Sr4)r�r�ros r6r�z"RetryCallState.seconds_since_start�s �� � !� )��4��%���7�7r9c�P�d|_d|_|xjdz c_d|_dS�Nr)r�r�r�r�ros r6r�z'RetryCallState.prepare_for_next_attempt�s3���� �!%��� ���q� �������r9�valc��tj��}t|j��}|�|��||c|_|_dSr4)r�r�r�r�r�r�r�)rfr��tsr�s r6r�zRetryCallState.set_result�sH�� �^� � ���T�(�)�)�� ���s����/2�B�,�� �d�,�,�,r9r�r�c��tj��}t|j��}|�|d��||c|_|_dSr�)r�r�r�r�r�r�r�)rfr�r�r�s r6r�zRetryCallState.set_exception�sN�� �^� � ���T�(�)�)�� ���(�1�+�&�&�&�/2�B�,�� �d�,�,�,r9c �d�|j�d}nU|jjr-|j���}d|jj�d|�d�}nd|j�����}t t|jd����}|jj}d|�dt|���d|j �d |�d |�d � S) Nznone yetzfailed (� riz returned �r�z : attempt #z ; slept for z; last result: �>) r�r�r�rDrEr�ry�roundr�r�r�)rfr�r��slept�clsnames r6rlzRetryCallState.__repr__�s��� �<� ��F�F� �\� � 9�� �.�.�0�0�I�K� � 3� <�K�K�y�K�K�K�F�F�8���!4�!4�!6�!6�8�8�F��e�D�M�1�-�-�.�.���.�)��r�7�r�r�R��X�X�r�r�$�2E�r�r�SX�r�r�io�r�r�r�rr9r�)rErSrTrUr�rqrur.r�rzr�ryr�r�r��Tupler�r�r�rlr5r9r6r�r��s������?�?�9�"�9� �J�y� !�9��e� 9� �� 9� � 9�9�9�9�:�8�Q�Z��%6�8�8�8��X�8�  � � � � 7�a�e�7��7�7�7�7� 7�a�g�a�f�]�.C�]�Ti�.i�&j�7�os�7�7�7�7� s� s� s� s� sr9r�)rF)rJ)Zr�r�r�r��typingrqrB�abcrr� concurrentr�inspectrr7rr r r r r rrrrrrr�naprrr�rrrrrrr�rrr r!r"r#r$r%�wait_full_jitterr�r&r'r�r(r)r�r*r+rG� TYPE_CHECKING�typesr,r-�TypeVarr�r.r0�overloadr�r�� ExceptionrRr�� NO_RESULTrWryr[r]rwrr�r�r�r�rKr�r��pip._vendor.tenacity._asynciorF�pip._vendor.tenacity.tornadowebrJr5r9r6�rs���&���� � � � ����� � � � ���������#�#�#�#�#�#�#�#�������'�'�'�'�'�'�������������������������%�%�%�%�%�%�*�*�*�*�*�*�.�.�.�.�.�.�&�&�&�&�&�&�"�"�"�"�"�"�������.�.�.�.�.�.�-�-�-�-�-�-�1�1�1�1�1�1�������"�"�"�"�"�"�%�$�$�$�$�$�"�"�"�"�"�"�������������������%�%�%�%�%�%�������������"�"�"�"�"�"�������#�#�#�#�#�#�������������)�)�)�)�)�)�=�=�=�=�=�=�������"�"�"�"�"�"������� � � � � � �+�*�*�*�*�*�.�.�.�.�.�.� ���?� ��L�L�L������������� �A�I�k��� 4� 4� 4� � �1�9�Z� � ���� �i� �I� � � � �� ��� �!�%� ��� �!�*�i�[�)�5K�*L� � � � �� ��!�%�����!�'�)�Q�Z�� �U^�H^�=_�2_�*`�����::�:�:�:�:�y�:�:�:� �F�H�H� � � � � � � � � � � � � � �e� � � ���������("�"�"�"�"�*�"�"�"� �����0�a�g�a�e�V�m�,�0�a�e�0���0�0�0�0� A� A� A� A� A�� A� A� A� ��������0i �i �i �i �i �3�i �i �i �X�����|����.�����W�^����.Cs�Cs�Cs�Cs�Cs�Cs�Cs�Cs�L8�7�7�7�7�7� �@�?�?�?�?�?�?�?�?�@�@r9