ReQG >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@fd0ZejBd1ejCd2ejCd/ej?e@ge@ffd3Zd1ejCd2ejCd/ejDe@ej?e@ge@fffd4ZGd5d6eEZFeGZHGd7d8ZIGd9d:eJZKGd;d<ZLGd=d>eLZMeGZNd?ejDejCeGfd@ejCd/ejCfdAZOGdBdCeEZPGdDdEZQGdFdGeZRGdHdIeRZSGdJdKe jTZTGdLdMZUddNlVmWZWe9rddOlXmYZYdSdS)PN)ABCabstractmethod)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_messagesleep)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_RetValTfnreturncdSN)r1s /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/tenacity/__init__.pyretryr7aDdargsdkwcdSr4r5)r:r;s r6r7r7fr8r9ctdkr2tdrtdSdtdtffd }|S)zWrap a function with a new `Retrying` object. :param dargs: positional arguments passed to Retrying object :param dkw: keyword arguments passed to the Retrying object rrfr2ct|tr/tjd|jjd|jjdt |r ti}nYtrFttj dr,tj |r ti}n ti}||S)NzGot retry_base instance (zQ) as callable argument, this will probably hang indefinitely (did you mean retry=z(...)?)is_coroutine_function) isinstancerwarningswarn __class____name__r AsyncRetryingtornadohasattrgenr@TornadoRetryingRetryingwraps)r>rr:r;s r6wrapzretry..wrapvs!Z((  n 0DnnPQP[Pdnnn#1%% ,$15$@C$@$@ ,WW[2IJJ ,w{OpOpqrOsOs ,#U2c22e+s++771:: r9)lencallabler7r.)r:r;rNs`` r6r7r7ksu 5zzQ8E!H--uwwuQx    I )        r9ceZdZdZdS)TryAgainz/Always retry the executed function when raised.N)rE __module__ __qualname____doc__r5r9r6rRrRs9999r9rRceZdZdS) DoAttemptNrErSrTr5r9r6rWrWDr9rWceZdZdS)DoSleepNrXr5r9r6r[r[rYr9r[cteZdZUdZdZejeed<dZ ej eed<defdZ defdZ 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_FIELDSNNAMEr2ctdfdjD}jjd|dS)Nz, c3BK|]}|dt|VdS)=N)getattr).0fieldselfs r6 z&BaseAction.__repr__..s;``eAAu)=)=AA``````r9())joinr^rDrE)rf state_strs` r6__repr__zBaseAction.__repr__sHII````tO_````` .)88I8888r9c t|Sr4)reprrfs r6__str__zBaseAction.__str__sDzzr9) rErSrTrUr^tSequencestr__annotations__r_Optionalrlrpr5r9r6r]r]s$&KC%%% D!*S/   9#9999r9r]c0eZdZdZdZdejddfdZdS) RetryActionrr7rr2Nc.t||_dSr4)floatr)rfrs r6__init__zRetryAction.__init__s5\\ r9)rErSrTr^r_rq SupportsFloatrzr5r9r6rwrwsBK D"ao"$""""""r9rwfirstsecondc|tur|n|Sr4)_unset)r|r}s r6 _first_setrsf__66%/r9c8eZdZdZd fd Zd dZdefd ZxZS) RetryErrorz>Encapsulates the last attempt instance right before giving up. last_attemptFuturer2NcX||_t|dSr4)rsuperrz)rfrrDs r6rzzRetryError.__init__s)( &&&&&r9 t.NoReturncP|jjr|j|r4)rfailedresultros r6reraisezRetryError.reraises*   # -#**,, , r9c0|jjd|jdS)N[])rDrErros r6rpzRetryError.__str__s!.)@@D,=@@@@r9)rrr2N)r2r) rErSrTrUrzrrsrp __classcell__rDs@r6rrs{HH'''''' AAAAAAAAAr9rc eZdZdZd dZddZdejeje d eje d ejd deje fd Z dS)AttemptManagerzManage attempt context. retry_stateRetryCallStatec||_dSr4r)rfrs r6rzzAttemptManager.__init__s&r9r2NcdSr4r5ros r6 __enter__zAttemptManager.__enter__s r9exc_type exc_value tracebacktypes.TracebackTypect|tr|j|||fdS|jddS)NT)rA BaseExceptionr set_exception set_result)rfrrrs r6__exit__zAttemptManager.__exit__sW i / /    * *Hi+K L L L4   ' ' - - -4r9)rrr2N) rErSrTrUrzrrqruTyperboolrr5r9r6rrs!!''''     *QVM23 :m, :34  D       r9rceZdZeeeeeedde 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 jffdZeeeeeeeeeef 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 jfefddfdZdefdZede jee jffdZdedefdZd dZdd de j e e!e jffdZ"de j#e$ddffdZ%e&de j de'fde jde jde'fdZ(dS)! BaseRetryingNFrstopr-waitr,r7beforerafter before_sleeprretry_error_clsretry_error_callbackc ||_||_||_||_||_||_||_||_tj |_ | |_ | |_ dSr4) rrrr7rrrr threadinglocal_localrr rfrrrr7rrrrrrs r6rzzBaseRetrying.__init__sb      ( o'' .$8!!!r9r2c |t||jt||jt||jt||jt||jt||jt||jt||j t| |j t| |j  S)z8Copy this object with some parameters changed if needed.) rrrr7rrrrrr) rDrrrrr7rrrrrrrs r6copyzBaseRetrying.copys~~UDJ//D$),,D$),,UDJ//fdk22UDJ//#L$2CDDw 55&8LMM!+,@$B[!\!\   r9cd|jjdt|dd|jd|jd|jd|jd|jd |jd S) N) rDrEidrrrr7rrros r6rlzBaseRetrying.__repr__s $' $ $bhh D $ $I $ $I $ $Z $ $Z  $ $ k  $ $ Z  $ $ $ r9cl |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 statisticsAttributeErrorros r6rzBaseRetrying.statistics"sH, *;) ) * * *%'DK ";) ) ) ) *s "33r>ctjdtjdtjdtjffd }dtjdtjdtffd }|_||_|S)z[Wrap a function for retrying. :param f: A function to wraps for retrying. argskwr2cg|Ri|Sr4r5)rrr>rfs r6 wrapped_fz%BaseRetrying.wraps..wrapped_fDs#4'D'''B'' 'r9kwargscDj|i|Sr4)rrL)rrr>rfs r6 retry_withz&BaseRetrying.wraps..retry_withHs(49d-f--33A66 6r9) functoolsrLrqAnyr.r7r)rfr>rrs`` r6rLzBaseRetrying.wraps>s    (QU (!% (AE ( ( ( ( ( (   ( 7ae 7qu 7 7 7 7 7 7 7 7 ) r9c|jtj|jd<d|jd<d|jd<dS)N start_timerattempt_numberridle_for)rcleartime monotonicros r6beginzBaseRetrying.beginPsI (,(8(8 %,-()&' ###r9rc|j}|*|j||tS|jjo+t |jt }|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)Nrdelay_since_first_attemptrrr)outcomerrWrrA exceptionrRr7rrseconds_since_startrrrrrrrw next_actionrrr[)rfrfutis_explicit_retry retry_excrs r6iterzBaseRetrying.iterVs! ;{& K(((;; '/6p:kFYFcFcFeFego;p;p! TZZKZ%H%H ::<<  : ! JJ{ # # #7B7V34 999 - - 1( >00===,,S11I| *''))) 0 9 II+I66EEE"-e"4"4 %  ###u,### ()))Q.)))   (   k * * *u~~r9c#VK|t|ddi} ||}t|trt |VnAt|t r*|||ndS)Nr5)r1rrTr) rrrrArWrr[prepare_for_next_attemptr)rfrdos r6__iter__zBaseRetrying.__iter__{s $TdBGGG  {33B"i(( $=======B(( 44666 2 r9r1.rrcdSr4r5)rfr1rrs r6__call__zBaseRetrying.__call__s r9r))rErSrTrrr#r r'r)rrqCallableUnionintryrrurrrrzrobjectrrsrlpropertyDictrr.rLrrWr[r Generatorrrrr0rr5r9r6rrs:?&%IKK33557E6CIM.8RV99z173:./5699 9  9  ,-t34 9z+,d239j-=,>,D!EF99 +9 j5E4F4M)NO99996KQ-3-3-3HNGMZ`)/?Eci  wqz173:#6"7"=>FG gk6)* gk6)*  wz6)*   $4#5t#;>>--clnn=====>B(( 44666 2  sA330B&%B&N) rErSrTrUrqrr0rrr5r9r6rKrKsZ1:c8m4QUaeX`r9rKc zeZdZdZdeddffd ZedefdZe dede j deddfd Z xZ S) rzDEncapsulates a (future or past) attempted call to a target function.rr2NcVt||_dSr4)rrzr)rfrrDs r6rzzFuture.__init__s' ,r9c.|duS)z8Return whether a exception is being held in this future.N)rros r6rz Future.faileds~~t++r9value has_exceptioncv||}|r||n|||S)zConstruct a new Future object.)rr)clsrrrrs r6 constructzFuture.constructsIc.!!  "   e $ $ $ $ NN5 ! ! ! r9)rErSrTrUrrzrrr classmethodrqrrrrs@r6rrsNN-s-t------,,,,X,s15RZ[r9rc eZdZdZdedejedejdejddf dZ e deje fd Z dd Z d ejddfd Zd ejejeedfddfdZdZdS)rz5State related to a single call wrapped with Retrying.rr1rrr2Nctj|_||_||_||_||_d|_d|_d|_ d|_ d|_ dS)Nrr) rrrrr1rrrroutcome_timestamprr)rfrr1rrs r6rzzRetryCallState.__init__s^.**(  $%+/ 48" 48r9c2|jdS|j|jz Sr4)rrros r6rz"RetryCallState.seconds_since_starts  ! )4%77r9cPd|_d|_|xjdz c_d|_dSNr)rrrrros r6rz'RetryCallState.prepare_for_next_attempts3 !% q r9valctj}t|j}||||c|_|_dSr4)rrrrrrr)rfrtsrs r6rzRetryCallState.set_resultsH ^  T()) s/2B, d,,,r9rrctj}t|j}||d||c|_|_dSr)rrrrrrr)rfrrrs r6rzRetryCallState.set_exceptionsN ^  T()) (1+&&&/2B, d,,,r9c d|jd}nU|jjr-|j}d|jjd|d}nd|j}t t|jd}|jj}d|dt|d|j d |d |d S) Nznone yetzfailed ( riz returned rz : attempt #z ; slept for z; last result: >) rrrrDrErryroundrrr)rfrrsleptclsnames r6rlzRetryCallState.__repr__s < FF \  9 ..00IK 3 <KKyKKKFF8!4!4!6!688FeDM1--...)r7rrRXXrr$2ErrSXrriorrrrr9r)rErSrTrUrrqrur.rrzrryrrrTuplerrrrlr5r9r6rrs??9"9 Jy !9e 9  9  9999:8QZ%6888X8     7ae77777 7agaf].C]Ti.i&j7os7777 s s s s sr9r)rF)rJ)ZrrrrtypingrqrBabcrr concurrentrinspectrr7rr r r r r rrrrrrrnaprrrrrrrrrrrrr r!r"r#r$r%wait_full_jitterrr&r'rr(r)rr*r+rG TYPE_CHECKINGtypesr,r-TypeVarrr.r0overloadrr ExceptionrRr NO_RESULTrWryr[r]rwrrrrrrKrrpip._vendor.tenacity._asynciorFpip._vendor.tenacity.tornadowebrJr5r9r6rs&  ########''''''%%%%%%******......&&&&&&""""""......------111111""""""%$$$$$""""""%%%%%%""""""######))))))======"""""" +*****...... ? LLL AIk 4 4 4 19Z  i I      !%  !*i[)5K*L     !%!')QZ U^H^=_2_*`::::::y::: FHH              e   ("""""*""" 0agaeVm,0ae00000 A A A A A A A A 0i i i i i 3i i i X|.W^.CsCsCsCsCsCsCsCsL877777 @????????@@r9