OwlCyberSecurity - MANAGER
Edit File: __init__.cpython-310.pyc
o ����ƚReQG������������������� ���@���s���d�dl�Z�d�dlZd�dlZd�dlZd�dlZd�dlZd�dlmZm Z �d�dl mZ�d�dlm Z �ddlmZ�ddlmZ�ddlmZ�dd lmZ�dd lmZ�ddlmZ�ddlmZ�dd lmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlm 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#l0m1Z1�dd$l0m2Z2�dd%l3m4Z4�dd&l3m5Z5�dd'l6m7Z7�dd(l6m8Z8�dZ9ej:�rd�dl;Z;dd)l&m<Z<�dd*lm=Z=�ej>d+ej?d,�Z@e�>d-�ZAejBd.e@d/e@fd0d1��ZejBd2ejCd3ejCd/ej?e@ge@f�fd4d1��Zd2ejCd3ejCd/ejDe@ej?e@ge@f�f�fd5d1�ZG�d6d7��d7eE�ZFeG��ZHG�d8d9��d9�ZIG�d:d;��d;eJ�ZKG�d<d=��d=�ZLG�d>d?��d?eL�ZMeG��ZNd@ejDejCeGf�dAejCd/ejCfdBdC�ZOG�dDdE��dEeE�ZPG�dFdG��dG�ZQG�dHdI��dIe�ZRG�dJdK��dKeR�ZSG�dLdM��dMejT�ZTG�dNdO��dO�ZUd�dPlVmWZW�e9�r�d�dQlXmYZY�dS�dS�)R�����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�����������������C�������d�S��N��)r0���r4���r4�����/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/tenacity/__init__.py�retrya�������r6����dargs�dkwc������������������O���r2���r3���r4����r8���r9���r4���r4���r5���r6���f���r7���c���������������������sB���t����dkrt��d��rt����d��S�dtdtf���fdd�}|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 r���r����fr1���c��������������������s����t�|�t�rt�d|�jj��d|�jj��d���t|��r!t��i����}ntr7t tj d�r7tj �|��r7t��i����}nt ��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:���r4���r5����wrapv���s��� �� zretry.<locals>.wrap)�len�callabler6���r-���)r8���r9���rJ���r4���r:���r5���r6���k���s���c�������������������@���s���e�Zd�ZdZdS�)�TryAgainz/Always retry the executed function when raised.N)rA���� __module__�__qualname__�__doc__r4���r4���r4���r5���rM�������s����rM���c�������������������@�������e�Zd�ZdS�)� DoAttemptN�rA���rN���rO���r4���r4���r4���r5���rR������������rR���c�������������������@���rQ���)�DoSleepNrS���r4���r4���r4���r5���rU�������rT���rU���c�������������������@���sR���e�Zd�ZU�dZdZeje�ed<�dZ ej e�ed<�defdd�Zdefd d �ZdS�)� BaseActiona5��Base 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 r4����REPR_FIELDSN�NAMEr1���c��������������������s.���d����fdd���jD���}��jj��d|��d�S�)Nz, c�����������������3���s$�����|�] }|��d�t���|���V��qdS�)�=N)�getattr)�.0�field��selfr4���r5���� <genexpr>����s����"�z&BaseAction.__repr__.<locals>.<genexpr>�(�))�joinrW���r@���rA���)r^���� state_strr4���r]���r5����__repr__����s���zBaseAction.__repr__c�����������������C���s���t�|��S�r3���)�reprr]���r4���r4���r5����__str__����s���zBaseAction.__str__) rA���rN���rO���rP���rW����t�Sequence�str�__annotations__rX����Optionalrd���rf���r4���r4���r4���r5���rV�������s��� �rV���c�������������������@���s(���e�Zd�ZdZdZdejddfdd�ZdS�)�RetryActionr���r6���r���r1���Nc�����������������C���s���t�|�|�_d�S�r3���)�floatr���)r^���r���r4���r4���r5����__init__����s���zRetryAction.__init__)rA���rN���rO���rW���rX���rg���� SupportsFloatrn���r4���r4���r4���r5���rl�������s����rl����first�secondc�����������������C���s���|�t�u�r|S�|�S�r3���)�_unset)rp���rq���r4���r4���r5���� _first_set����s���rs���c�����������������������s:���e�Zd�ZdZd ��fdd�Zdd d �Zdefdd�Z���ZS�)� RetryErrorz>Encapsulates the last attempt instance right before giving up.�last_attempt�Futurer1���Nc��������������������s���||�_�t���|��d�S�r3���)ru����superrn���)r^���ru����r@���r4���r5���rn�������s���zRetryError.__init__� t.NoReturnc�����������������C���s���|�j�jr |�j�����|��r3���)ru����failed�resultr]���r4���r4���r5����reraise����s��� zRetryError.reraisec�����������������C���s���|�j�j��d|�j��d�S�)N�[�])r@���rA���ru���r]���r4���r4���r5���rf�����������zRetryError.__str__)ru���rv���r1���N)r1���ry���) rA���rN���rO���rP���rn���r|���ri���rf���� __classcell__r4���r4���rx���r5���rt�������s ���� rt���c���������������� ���@���s\���e�Zd�ZdZddd�Zddd �Zd ejeje ��deje �dejd �deje �fdd�ZdS�)�AttemptManagerzManage attempt context.�retry_state�RetryCallStatec�����������������C���s ���||�_�d�S�r3����r����)r^���r����r4���r4���r5���rn�������s��� zAttemptManager.__init__r1���Nc�����������������C���r2���r3���r4���r]���r4���r4���r5���� __enter__����s���zAttemptManager.__enter__�exc_type� exc_value� traceback�types.TracebackTypec�����������������C���s0���t�|t�r|�j�|||f��dS�|�j�d���d�S�)NT)r=���� BaseExceptionr����� set_exception� set_result)r^���r����r����r����r4���r4���r5����__exit__����s ��� zAttemptManager.__exit__)r����r�����r1���N)rA���rN���rO���rP���rn���r����rg���rk����Typer�����boolr����r4���r4���r4���r5���r��������s���� ����r����c�������������������@���sj��e�Zd�Zeee��e��eedde df de je je ef�gdf�ddddded e jd gdf�de jd gdf�de je jd gdf��d ede je �de je jd ge jf��fdd�Zeeeeeeeeeef de je je je ef�gdf�ef�de jdef�de jdef�de jeef�d e je jd gdf�ef�de je jd gdf�ef�de je je jd gdf��ef�d e jeef�de je je �ef�de je je jd ge jf��ef�dd�fdd�Zdefdd�Zede jee jf�fdd��Zdedefdd�Zd)dd�Zdd de je e!e jf�fdd �Z"de j#e$ddf�fd!d"�Z%e&d#e jd$e'f�d%e jd&e jde'fd'd(��Z(dS�)*�BaseRetryingNFr����stopr,����waitr+���r6����beforer�����after�before_sleepr|����retry_error_cls�retry_error_callbackc�����������������C���sJ���||�_�||�_||�_||�_||�_||�_||�_||�_t� ��|�_ | |�_| |�_d�S�r3���) r���r����r����r6���r����r����r����r|���� threading�local�_localr����r�����r^���r���r����r����r6���r����r����r����r|���r����r����r4���r4���r5���rn�������s��� zBaseRetrying.__init__r1���c�������������� ���C���sn���|�j�t||�j�t||�j�t||�j�t||�j�t||�j�t||�j�t||�j�t||�j �t| |�j �t| |�j�d� S�)z8Copy this object with some parameters changed if needed.) r���r����r����r6���r����r����r����r|���r����r����)r@���rs���r���r����r����r6���r����r����r����r|���r����r����r����r4���r4���r5����copy����s��� �zBaseRetrying.copyc�����������������C���sL���d|�j�j��dt|��d�d|�j��d|�j��d|�j��d|�j��d|�j��d |�j��d �S�)N�<z object at 0x�xz (stop=z, wait=z, sleep=z, retry=z , before=z, after=z)>) r@���rA����idr����r����r���r6���r����r����r]���r4���r4���r5���rd�����s����������zBaseRetrying.__repr__c�����������������C���s.���z|�j�jW�S��ty���i�|�j�_|�j�j�Y�S�w�)aS��Return 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�AttributeErrorr]���r4���r4���r5���r����"��s��� �zBaseRetrying.statisticsr;���c��������������������s\���t�����dtjdtjdtjf���fdd��}dtjdtjdtf���fdd�}�|_||_|S�) z[Wrap a function for retrying. :param f: A function to wraps for retrying. �args�kwr1���c���������������������s������g|��R�i�|��S�r3���r4���)r����r�����r;���r^���r4���r5���� wrapped_fD��s���z%BaseRetrying.wraps.<locals>.wrapped_f�kwargsc���������������������s����j�|�i�|������S�r3���)r����rH���)r����r����r����r4���r5���� retry_withH��r���z&BaseRetrying.wraps.<locals>.retry_with)� functoolsrH���rg����Anyr-���r6���r����)r^���r;���r����r����r4���r����r5���rH���>��s���$ zBaseRetrying.wrapsc�����������������C���s0���|�j�����t���|�j�d<�d|�j�d<�d|�j�d<�d�S�)N� start_timer����attempt_numberr����idle_for)r�����clear�time� monotonicr]���r4���r4���r5����beginP��s��� zBaseRetrying.beginr����c�����������������C���s&��|j�}|d�u�r|�jd�ur|��|��t��S�|j�jot|j����t�}|s,|�j|d�s,|���S�|�j d�ur6|�� |��|j |�jd<�|�j|d�r[|�j rJ|�� |�S�|��|�}|�jrV|����||����|�jre|�j|d�}nd}t|�|_|�j|7��_|�jd��|7��<�|�jd��d7��<�|�jd�ur�|��|��t|�S�)Nr�����delay_since_first_attempt���������r����r����r���)�outcomer����rR���rz���r=���� exceptionrM���r6���r{���r�����seconds_since_startr����r����r����r����r|���r����rl����next_actionr����r����rU���)r^���r�����fut�is_explicit_retry� retry_excr���r4���r4���r5����iterV��s8��� zBaseRetrying.iterc�����������������c���sd�����|������t|�d�di�d�} �|�j|d�}t|t�r t|d�V��nt|t�r/|����|��|��nd�S�q)Nr4���)r0���r����r����Tr����) r����r����r����r=���rR���r����rU����prepare_for_next_attemptr���)r^���r�����dor4���r4���r5����__iter__{��s���� �zBaseRetrying.__iter__r0���.r����r����c�����������������O���r2���r3���r4���)r^���r0���r����r����r4���r4���r5����__call__���r7���zBaseRetrying.__call__r����))rA���rN���rO���r���r���r"���r���r&���r(���rt���rg����Callable�Union�intrm���r���rk���r����r����r����rn���rr����objectr����ri���rd����property�Dictr����r-���rH���r����rR���rU���r����� Generatorr����r����r���r/���r����r4���r4���r4���r5���r��������s������������� � � ��"������� � � � � %.r����c�������������������@���s8���e�Zd�ZdZdejdef�dejdejdefdd�Zd S�) rG���zRetrying controller.r0���.r����r����r1���c�����������������O���s����|������t|�|||d�} �|�j|d�}t|t�r8z ||i�|��}W�n�ty1���|�t�����Y�nw�|� |��nt|t �rG|����|��|��n|S�q )N)�retry_objectr0���r����r����Tr����) r����r����r����r=���rR���r����r�����sys�exc_infor����rU���r����r���)r^���r0���r����r����r����r����r{���r4���r4���r5���r�������s ��� � �zRetrying.__call__N) rA���rN���rO���rP���rg���r����r/���r����r����r4���r4���r4���r5���rG������s����,rG���c���������������� �������s\���e�Zd�ZdZdeddf��fdd�Zedefdd��Ze ded e jd edd�fdd��Z���Z S�) rv���zDEncapsulates a (future or past) attempted call to a target function.r����r1���Nc��������������������s���t�������||�_d�S�r3���)rw���rn���r����)r^���r����rx���r4���r5���rn������s��� zFuture.__init__c�����������������C���s���|�����duS�)z8Return whether a exception is being held in this future.N)r����r]���r4���r4���r5���rz������s���z Future.failed�value� has_exceptionc�����������������C���s(���|�|�}|r |��|��|S�|�|��|S�)zConstruct a new Future object.)r����r����)�clsr����r����r����r����r4���r4���r5���� construct���s��� �zFuture.construct)rA���rN���rO���rP���r����rn���r����r����rz����classmethodrg���r����r����r����r4���r4���rx���r5���rv������s����&rv���c���������������� ���@���s����e�Zd�ZdZdedeje�dejdejddf dd �Z e deje�fd d��Zddd �Z dejddfdd�Zdejeje�edf�ddfdd�Zdd��ZdS�)r����z5State related to a single call wrapped with Retrying.r����r0���r����r����r1���Nc�����������������C���sD���t����|�_||�_||�_||�_||�_d|�_d�|�_d�|�_ d|�_ d�|�_d�S�)Nr���r����)r����r����r����r����r0���r����r����r����r�����outcome_timestampr����r����)r^���r����r0���r����r����r4���r4���r5���rn������s��� zRetryCallState.__init__c�����������������C���s���|�j�d�u�rd�S�|�j�|�j�S�r3���)r����r����r]���r4���r4���r5���r�������s��� z"RetryCallState.seconds_since_startc�����������������C���s$���d�|�_�d�|�_|��jd7��_d�|�_d�S��Nr���)r����r����r����r����r]���r4���r4���r5���r�������s��� z'RetryCallState.prepare_for_next_attempt�valc�����������������C���s.���t����}t|�j�}|�|��|||�_|�_d�S�r3���)r����r����rv���r����r����r����r����)r^���r�����tsr����r4���r4���r5���r�������s��� zRetryCallState.set_resultr����r����c�����������������C���s2���t����}t|�j�}|�|d���|||�_|�_d�S�r����)r����r����rv���r����r����r����r����)r^���r����r����r����r4���r4���r5���r�������s��� zRetryCallState.set_exceptionc�����������������C���s����|�j�d�u�rd}n|�j�jr|�j����}d|jj��d|��d�}nd|�j�������}tt|�jd��}|�jj}d|��dt |����d|�j ��d |��d |��d�S�)Nznone yetzfailed (� ra���z returned ����r����z: attempt #z; slept for z; last result: �>)r����rz���r����r@���rA���r{���rm����roundr����r����r����)r^���r{���r�����slept�clsnamer4���r4���r5���rd������s��� *zRetryCallState.__repr__r����)rA���rN���rO���rP���r����rg���rk���r-���r����rn���r����rm���r����r����r�����Tupler����r����r����rd���r4���r4���r4���r5���r�������s&�������� � $r����)rB���)rF���)Zr����r����r����r�����typingrg���r>����abcr���r���� concurrentr����inspectr���r6���r���r���r ���r ���r���r���r ���r���r���r���r���r���r����napr���r���r����r���r���r���r���r���r���r����r���r���r���r ���r!���r"���r#���r$����wait_full_jitterr����r%���r&���r����r'���r(���r����r)���r*���rC���� TYPE_CHECKING�typesr+���r,����TypeVarr����r-���r/����overloadr����r����� ExceptionrM���r����� NO_RESULTrR���rm���rU���rV���rl���rr���rs���rt���r����r����rG���rv���r�����pip._vendor.tenacity._asynciorB���Zpip._vendor.tenacity.tornadowebrF���r4���r4���r4���r5����<module>���s���� (0&�-F�