+
    ib                     >   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
Ht ^ RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIH t  ^RIH!t! ^RI"H#t# ^RI"H$t$ ^RI"H%t% ^RI"H&t& ^RI"H't' ^RI"H(t( ^RI"H)t) ^RI*H+t+ ^RI*H,t, ^RI*H-t- ^RI*H.t. ^R I*H/t/ ^R!I*H0t0 ^R"I*H1t1 ^R#I*H2t2 ^R$I*H3t3 ^R$I*H3t4 ^R%I*H5t5 ^R&I6H7t7 ^R'I6H8t8 ^R(I9H:t: ^R)I9H;t; ^R*I<H=t= ^R+I<H>t>  ^ RI?t?]P                  '       d   ^ R,IBHCtC ^R-IHDtE ^R.IHFtF ^R/I"HGtG ^R0I*HHtH ]P                  ! R14      tJ]P                  ! R2]P                  R3]P                  3,          R47      tM]P                  ! R54      tO]P                  ! R64      tP] P                  ! R7R87       ! R9 R:4      4       tR ! R; R<]S4      tT]U! 4       tV ! R= R>4      tW ! R? R@]X4      tY ! RA RB4      tZ ! RC RD]Z4      t[]U! 4       t\RE RF lt] ! RG RH]S4      t^ ! RI RJ4      t_ ! RK RL]
4      t` ! RM RN]`4      ta ! RO RP]P                  ]P                  ,          4      tb ! RQ RR4      tc ! RS RT]P                  4      te]P                  RU RV l4       t]P                  RWR3RXR3RYR3RZR3R[R3R\R3R]R3R^R3R_R3/	R` Ra ll4       t]P                  ] ](]1! 4       ]! 4       ]8];RRb]^R3
Rc Rd ll4       tRe Rf lt^ RgIgHhth ]?'       d   ^ RhIiHjtj . RiNRjNRkNRlNRmNRnNRoNRpNRqNRrNRsNRtNRuNRvNRwNRxNRyNRzNR{NR|NR}NR~NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRYNR2NR<NRNR>NR@NRBNRDNRHNRJNRLNRNNRPNRRNRNtkR#   ]@ d    Rt? ELqi ; i)    N)ABCabstractmethod)futures)_utils)
retry_base)	retry_all)retry_always)	retry_any)retry_if_exception)retry_if_exception_type)retry_if_exception_cause_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_before_delay)stop_all)stop_any)
stop_never)stop_when_event_set)
wait_chain)wait_combine)wait_exception)wait_exponential)
wait_fixed)wait_incrementing)	wait_none)wait_random)wait_random_exponential)wait_exponential_jitter)
before_log)before_nothing)	after_log)after_nothing)before_sleep_log)before_sleep_nothing)Self)asyncio)
RetryBaseT)	StopBaseT)	WaitBaseTWrappedFnReturnT	WrappedFn.)boundPRT)slotsc                   t   a  ] tR t^it o ]P
                  ! ]R7      tRt^ t	Rt
RtV 3R lR ltV 3R ltRtV tR# )	IterState)default_factoryFc                   < V ^8  d   QhRR/#    returnN )format__classdict__s   "d/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/tenacity/__init__.py__annotate__IterState.__annotate__s   s     ' 't '    c                L    . V n         R V n        ^ V n        R V n        R V n        R# )FN)actionsretry_run_resultdelay_since_first_attemptstop_run_resultis_explicit_retryselfs   &rD   resetIterState.resets   s)     %)*&$!&rG   c                   < V ^8  d   Qh/ S[ P                  S[ P                  R.S[ P                  3,          ,          ;R&   S[;R&   S[;R&   S[;R&   S[;R&   # )r?   RetryCallStaterI   rJ   rK   rL   rM   )tListCallableAnyboolint)rB   rC   s   "rD   rE   rF   i   se     VVAJJ 0115589:  
 "   #&  !  # rG   )rI   rK   rM   rJ   rL   N)__name__
__module____qualname____firstlineno__dataclassesfieldlistrI   rJ   rK   rL   rM   rP   __annotate_func____static_attributes____classdictcell__rC   s   @rD   r;   r;   i   sB     =H=N=N>G #%&!O#' '  rG   r;   c                       ] tR t^{tRtRtR# )TryAgainz/Always retry the executed function when raised.rA   N)rZ   r[   r\   r]   __doc__rb   rA   rG   rD   rf   rf   {   s    9rG   rf   c                       ] tR t^tRtR# )	DoAttemptrA   NrZ   r[   r\   r]   rb   rA   rG   rD   ri   ri          rG   ri   c                       ] tR t^tRtR# )DoSleeprA   Nrj   rA   rG   rD   rm   rm      rk   rG   rm   c                   \   a  ] tR t^t o RtRtRtV 3R lR ltV 3R lR ltV 3R lt	Rt
V tR# )	
BaseActiona!  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
Nc                    < V ^8  d   QhRS[ /# r?   r@   str)rB   rC   s   "rD   rE   BaseAction.__annotate__   s     9 9# 9rG   c                   a  R P                  V 3R lS P                   4       4      pS P                  P                   RV R2# )z, c              3   F   <"   T F  q R \        SV4      : 2x  K  	  R# 5i)=N)getattr).0r_   rO   s   & rD   	<genexpr>&BaseAction.__repr__.<locals>.<genexpr>   s&      
=MEgQwtU+./=Ms   !())joinREPR_FIELDS	__class__rZ   )rO   	state_strs   f rD   __repr__BaseAction.__repr__   sD    II 
=A=M=M
 
	 ..))*!I;a88rG   c                    < V ^8  d   QhRS[ /# rq   rr   )rB   rC   s   "rD   rE   rt      s       rG   c                    \        V 4      # N)reprrN   s   &rD   __str__BaseAction.__str__   s    DzrG   c                z   < V ^8  d   Qh/ S[ P                  S[,          ;R&   S[ P                  S[,          ;R&   # )r?   r   NAME)rT   Sequencers   Optional)rB   rC   s   "rD   rE   rt      s/      C%  **S/  rG   rA   )rZ   r[   r\   r]   rg   r   r   r   r   ra   rb   rc   rd   s   @rD   ro   ro      s1      $&K D9 9 %  rG   ro   c                   :   a  ] tR t^t o RtRtV 3R lR ltRtV tR# )RetryActionretryc                8   < V ^8  d   QhRS[ P                  RR/# )r?   r   r@   N)rT   SupportsFloat)rB   rC   s   "rD   rE   RetryAction.__annotate__   s     " "aoo "$ "rG   c                &    \        V4      V n        R # r   )floatr   )rO   r   s   &&rD   __init__RetryAction.__init__   s    5\
rG   r   N)	rZ   r[   r\   r]   r   r   r   rb   rc   rd   s   @rD   r   r      s     KD" "rG   r   c                    V ^8  d   QhR\         P                  \         P                  \        3,          R\         P                  R\         P                  /# )r?   firstsecondr@   )rT   UnionrW   object)rB   s   "rD   rE   rE      s:     0 0aggaeeVm, 0aee 0 0rG   c                     V \         J d   V# T # r   )_unset)r   r   s   &&rD   
_first_setr      s    f_6/%/rG   c                   f   a a ] tR t^t oRtV3R lV 3R lltV3R lR ltV3R lR ltRtVt	V ;t
# )	
RetryErrorz>Encapsulates the last attempt instance right before giving up.c                "   < V ^8  d   QhRRRR/# )r?   last_attemptFuturer@   NrA   )rB   rC   s   "rD   rE   RetryError.__annotate__   s     ' 'X '$ 'rG   c                2   < Wn         \        SV `	  V4       R # r   )r   superr   )rO   r   r   s   &&rD   r   RetryError.__init__   s    (&rG   c                4   < V ^8  d   QhRS[ P                  /# rq   )rT   NoReturn)rB   rC   s   "rD   rE   r      s       rG   c                r    V P                   P                  '       d   V P                   P                  4       hV hr   )r   failedresultrN   s   &rD   reraiseRetryError.reraise   s.    #####**,,
rG   c                    < V ^8  d   QhRS[ /# rq   rr   )rB   rC   s   "rD   rE   r      s     A A ArG   c                N    V P                   P                   R V P                   R2# )[])r   rZ   r   rN   s   &rD   r   RetryError.__str__   s'    ..))*!D,=,=+>a@@rG   )r   )rZ   r[   r\   r]   rg   r   r   r   rb   rc   __classcell__r   rC   s   @@rD   r   r      s.     H' ' 
A A ArG   r   c                   Z   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltRtV t	R	# )
AttemptManagerzManage attempt context.c                   < V ^8  d   QhRR/# )r?   retry_staterS   rA   )rB   rC   s   "rD   rE   AttemptManager.__annotate__   s     ' '$4 'rG   c                    Wn         R # r   r   rO   r   s   &&rD   r   AttemptManager.__init__   s    &rG   c                   < V ^8  d   QhRR/# r>   rA   )rB   rC   s   "rD   rE   r      s      4 rG   c                    R # r   rA   rN   s   &rD   	__enter__AttemptManager.__enter__   s    rG   c          	         < V ^8  d   QhRS[ P                  S[ P                  S[,          ,          RS[ P                  S[,          RS[ P                  R,          RS[ P                  S[,          /# )r?   exc_type	exc_value	tracebackztypes.TracebackTyper@   )rT   r   TypeBaseExceptionrX   )rB   rC   s   "rD   rE   r      sa      **QVVM23 ::m, ::34	
 
D	rG   c                    Ve$   Ve    V P                   P                  WV34       R# V P                   P                  R 4       R # )NT)r   set_exception
set_result)rO   r   r   r   s   &&&&rD   __exit__AttemptManager.__exit__   sD     I$9**H+KL ''-rG   r   N)
rZ   r[   r\   r]   rg   r   r   r   rb   rc   rd   s   @rD   r   r      s&     !' '  rG   r   c            
         a  ] tR t^t o ]]]! 4       ]! 4       ]]	RR]
R3
V 3R lR llt]]]]]]]]]]3
V 3R lR lltV 3R lR lt]V 3R	 lR
 l4       t]V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR  ltV 3R! lR" lt]V 3R# lR$ l4       tR%tV t R# )&BaseRetryingNFc                  < V ^8  d   QhRS[ P                  S[ P                  S[S[3,          .R3,          RRRRRRR	S[ P                  R
.R3,          RS[ P                  R
.R3,          RS[ P
                  S[ P                  R
.R3,          ,          RS[RS[ P                  S[,          RS[ P
                  S[ P                  R
.S[ P                  3,          ,          /
# )r?   r   Nstopr2   waitr3   r   r1   beforerS   afterbefore_sleepr   retry_error_clsretry_error_callback)
rT   rV   r   rY   r   r   rX   r   r   rW   )rB   rC   s   "rD   rE   BaseRetrying.__annotate__   s     9 9zz1773:./569 9 	9
 9 

,-t349 zz+,d239 jj-=,>,D!EF9 9 
+9  jj5E4F4M)NO9rG   c                    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Wn        \        P                  ! 4       V n
        Wn        Wn        R # r   )r   r   r   r   r   r   r   r   	threadinglocal_localr   r   rO   r   r   r   r   r   r   r   r   r   r   s   &&&&&&&&&&&rD   r   BaseRetrying.__init__   sG     
		

(oo'.$8!rG   c                p  < V ^8  d   QhRS[ P                  S[ P                  S[ P                  S[S[3,          .R3,          S[3,          RS[ P                  RS[3,          RS[ P                  RS[3,          RS[ P                  S[S[3,          RS[ P                  S[ P                  R	.R3,          S[3,          R
S[ P                  S[ P                  R	.R3,          S[3,          RS[ P                  S[ P                  S[ P                  R	.R3,          ,          S[3,          RS[ P                  S[S[3,          RS[ P                  S[ P                  S[
,          S[3,          RS[ P                  S[ P                  S[ P                  R	.S[ P                  3,          ,          S[3,          RR/# )r?   r   Nr   r2   r   r3   r   r   rS   r   r   r   r   r   r@   r/   )rT   r   rV   rY   r   r   r   r   rX   r   r   rW   )rB   rC   s   "rD   rE   r      s    
 
wwqzz1773:#6"7"=>FG
 ggk6)*
 ggk6)*	

 wwz6)*
 

$4#5t#;<fDE
 wwqzz#3"4d":;VCD
 ggJJqzz#3"4d":;<fD

 v&
 
!3V!;<
  ggJJqzz#3"4aee";<=vE

  
!
rG   c                   V P                  \        WP                  4      \        W P                  4      \        W0P                  4      \        W@P
                  4      \        WPP                  4      \        W`P                  4      \        WpP                  4      \        WP                  4      \        WP                  4      \        WP                  4      R7
      # )z8Copy this object with some parameters changed if needed.
r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   s   &&&&&&&&&&&rD   copyBaseRetrying.copy   s    $ ~~UJJ/D)),D)),UJJ/fkk2UJJ/#L2C2CDw5&8L8LM!+$&?&?"  
 	
rG   c                    < V ^8  d   QhRS[ /# rq   rr   )rB   rC   s   "rD   rE   r     s     	
 	
# 	
rG   c                    R V P                   P                   R\        V 4      R RV P                   RV P                   RV P
                   RV P                   RV P                   RV P                   R	2# )
<z object at 0xxz (stop=z, wait=z, sleep=z, retry=z	, before=z, after=z)>)	r   rZ   idr   r   r   r   r   r   rN   s   &rD   r   BaseRetrying.__repr__  s    ''(bhq\ BII; II; ZZL !ZZL !kk] #ZZL$	
rG   c                ^   < V ^8  d   QhRS[ P                  S[S[ P                  3,          /# rq   )rT   Dictrs   rW   )rB   rC   s   "rD   rE   r     s%     & &AFF3:. &rG   c                   \        V P                  R4      '       gP   \        P                  ! \        P                  \
        \        P                  3,          / 4      V P                  n        V P                  P                  # )a  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).

statistics)hasattrr   rT   castr   rs   rW   r   rN   s   &rD   r   BaseRetrying.statistics  sM    , t{{L11%&VVAFF3:,>%CDKK"{{%%%rG   c                    < V ^8  d   QhRS[ /# rq   )r;   )rB   rC   s   "rD   rE   r   8  s     & &I &rG   c                    \        V P                  R 4      '       g   \        4       V P                  n        V P                  P                  # )
iter_state)r   r   r;   r   rN   s   &rD   r   BaseRetrying.iter_state7  s1    t{{L11%.[DKK"{{%%%rG   c                &   < V ^8  d   QhRS[ RS[ /# r?   fr@   r5   )rB   rC   s   "rD   rE   r   =  s      y Y rG   c                   a aa \         P                  ! S\         P                  R,           4      R VV V3R ll4       oR VV 3R llpS Sn        VSn        / Sn        S# )zKWrap a function for retrying.

:param f: A function to wraps for retrying.
c                x    V ^8  d   QhR\         P                  R\         P                  R\         P                  /# )r?   argskwr@   rT   rW   )rB   s   "rD   rE   (BaseRetrying.wraps.<locals>.__annotate__F  s-     	( 	(QUU 	(!%% 	(AEE 	(rG   c                  ^   < SP                  4       pVP                  Sn        V! S.V O5/ VB # r   )r   r   )r   r   r   r   rO   	wrapped_fs   *, rD   r  %BaseRetrying.wraps.<locals>.wrapped_fC  s1     99;D#'??I 'D'B''rG   c                d    V ^8  d   QhR\         P                  R\         P                  R\        /# )r?   r   kwargsr@   )rT   rW   r5   )rB   s   "rD   rE   r   M  s)     	7 	7aee 	7quu 	7 	7rG   c                  F   < SP                   ! V / VB P                  S4      # r   )r   wraps)r   r  r   rO   s   *,rD   
retry_with&BaseRetrying.wraps.<locals>.retry_withM  s"    99d-f-33A66rG   )__defaults____kwdefaults__)	functoolsr  WRAPPER_ASSIGNMENTSr   r  r   )rO   r   r  r  s   ff @rD   r  BaseRetrying.wraps=  s_     
y,,/QQ

	( 	(

	(	7 	7 	)	!	rG   c                   < V ^8  d   QhRR/# r>   rA   )rB   rC   s   "rD   rE   r   W  s     ( (t (rG   c                    V P                   P                  4        \        P                  ! 4       V P                   R &   ^V P                   R&   ^ V P                   R&   R# )
start_timeattempt_numberidle_forN)r   cleartime	monotonicrN   s   &rD   beginBaseRetrying.beginW  sD    (,(8%,-()&'
#rG   c                `   < V ^8  d   QhRS[ P                  RS[ P                  3,          RR/# )r?   fn.r@   N)rT   rV   rW   )rB   rC   s   "rD   rE   r   ]  s,     + +1::c155j#9 +d +rG   c                P    V P                   P                  P                  V4       R # r   )r   rI   appendrO   r  s   &&rD   _add_action_funcBaseRetrying._add_action_func]  s    &&r*rG   c                "   < V ^8  d   QhRRRR/# r?   r   rS   r@   NrA   )rB   rC   s   "rD   rE   r   `  s      C C&6 C4 CrG   c                F    V P                  V4      V P                  n        R # r   )r   r   rJ   r   s   &&rD   
_run_retryBaseRetrying._run_retry`  s    +/::k+B(rG   c                "   < V ^8  d   QhRRRR/# r   rA   )rB   rC   s   "rD   rE   r   c  s     + +%5 +$ +rG   c                ^    V P                   '       d   V P                  V4      pMR pW!n        R# )        N)r   upcoming_sleep)rO   r   r   s   && rD   	_run_waitBaseRetrying._run_waitc  s$    999IIk*EE%*"rG   c                "   < V ^8  d   QhRRRR/# r   rA   )rB   rC   s   "rD   rE   r   k  s      A A%5 A$ ArG   c                x    VP                   V P                  R &   V P                  V4      V P                  n        R# )rK   N)seconds_since_startr   r   r   rL   r   s   &&rD   	_run_stopBaseRetrying._run_stopk  s,    7B7V7V34*.))K*@'rG   c                f   < V ^8  d   QhRRRS[ P                  S[S[S[ P                  3,          /# )r?   r   rS   r@   )rT   r   ri   rm   rW   )rB   rC   s   "rD   rE   r   o  s3       0 QWWYQRQVQV=V5W rG   c                v    V P                  V4       R pV P                  P                   F  pV! V4      pK  	  V# r   )_begin_iterr   rI   )rO   r   r   actions   &&  rD   iterBaseRetrying.itero  s8    %oo--FK(F .rG   c                "   < V ^8  d   QhRRRR/# r   rA   )rB   rC   s   "rD   rE   r   v  s     > >'7 >D >rG   c                   V P                   P                  4        VP                  pVf>   V P                  e   V P	                  V P                  4       V P	                  R 4       R # VP
                  ;'       d    \        VP                  4       \        4      V P                   n	        V P                   P                  '       g   V P	                  V P                  4       V P	                  V P                  4       R # )Nc                     \        4       # r   )ri   rss   &rD   <lambda>*BaseRetrying._begin_iter.<locals>.<lambda>}  s    Y[rG   )r   rP   outcomer   r  r   
isinstance	exceptionrf   rM   r"  _post_retry_check_actions)rO   r   futs   && rD   r1  BaseRetrying._begin_iterv  s    !!;{{&%%dkk2!!"89,/JJ -
 -
:MMOX<
) 000!!$//2d<<=rG   c                "   < V ^8  d   QhRRRR/# r   rA   )rB   rC   s   "rD   rE   r     s     
= 
=5E 
=$ 
=rG   c                   V P                   P                  '       g1   V P                   P                  '       g   V P                  R  4       R# V P                  e   V P                  V P                  4       V P                  V P
                  4       V P                  V P                  4       V P                  V P                  4       R# )c                 6    V P                   P                  4       # r   )r<  r   r8  s   &rD   r:  8BaseRetrying._post_retry_check_actions.<locals>.<lambda>  s    RZZ->->-@rG   N)r   rM   rJ   r  r   r(  r-  _post_stop_check_actionsr   s   &&rD   r?  &BaseRetrying._post_retry_check_actions  s    111T__5U5U5U!!"@A::!!!$**-dnn-dnn-d;;<rG   c                "   < V ^8  d   QhRRRR/# r   rA   )rB   rC   s   "rD   rE   r     s      E E4D E ErG   c                  a  S P                   P                  '       dL   S P                  '       d   S P                  S P                  4       R # R V 3R llpS P                  V4       R # R V 3R llpS P                  V4       S P                  e   S P                  S P                  4       S P                  R 4       R # )Nc                     V ^8  d   QhRRRR/# r?   r9  rS   r@   NrA   )rB   s   "rD   rE   ;BaseRetrying._post_stop_check_actions.<locals>.__annotate__  s     5 5. 54 5rG   c                    < \         P                  ! \        V P                  4      pSP	                  V4      pSP
                  '       d   VP                  4       hW!P                  4       hr   )rT   r   r   r<  r   r   r>  )r9  r@  	retry_excrO   s   &  rD   	exc_check8BaseRetrying._post_stop_check_actions.<locals>.exc_check  sK    ffVRZZ0 005	<<<#++--]]_4rG   c                     V ^8  d   QhRRRR/# rK  rA   )rB   s   "rD   rE   rL    s     	3 	3, 	3 	3rG   c                    < V P                   p\        V4      V n        V ;P                  V,          un        SP                  R ;;,          V,          uu&   SP                  R;;,          ^,          uu&   R# )r  r  N)r'  r   next_actionr  r   )r9  r   rO   s   & rD   rS  :BaseRetrying._post_stop_check_actions.<locals>.next_action  sQ    %%E(/BNKK5 KOOJ'50'OO,-2-rG   c                 ,    \        V P                  4      # r   )rm   r'  r8  s   &rD   r:  7BaseRetrying._post_stop_check_actions.<locals>.<lambda>  s    1B1B)CrG   )r   rL   r   r  r   )rO   r   rO  rS  s   f&  rD   rF  %BaseRetrying._post_stop_check_actions  s    ??***(((%%d&?&?@5 5 !!),	3 	3 	k*(!!$"3"34CDrG   c                J   < V ^8  d   QhRS[ P                  S[RR3,          /# r>   )rT   	Generatorr   )rB   rC   s   "rD   rE   r     s$      !++ndD&@A rG   c              #  0  "   V P                  4        \        V R R/ R7      p V P                  VR7      p\        V\        4      '       d   \        VR7      x  K9  \        V\        4      '       d$   VP                  4        V P                  V4       Kr  R # 5i)N)r  r   r  r   rA   )	r  rS   r3  r=  ri   r   rm   prepare_for_next_attemptr   )rO   r   dos   &  rD   __iter__BaseRetrying.__iter__  sp     

$TdBG{3B"i(($==B((446

2s   BBc                   < V ^8  d   QhRS[ P                  RS[3,          RS[ P                  RS[ P                  RS[/# r?   r  .r   r  r@   rT   rV   r4   rW   )rB   rC   s   "rD   rE   r     sJ      JJs,,- uu %%	
 
rG   c                    R # r   rA   )rO   r  r   r  s   &&*,rD   __call__BaseRetrying.__call__  s     	rG   )r   r   r   r   r   r   r   r   r   r   r   )!rZ   r[   r\   r]   r   r   r%   r   r*   r,   r   r   r   r   r   propertyr   r   r  r  r  r"  r(  r-  r3  r1  r?  rF  r]  r   rc  rb   rc   rd   s   @rD   r   r      s     :?&%K577E6CIM.8RV9 96 KQ-3-3-3HNGM )/?E 
 
B	
 	
 & &2 & &
 4( (+ +C C+ +A A > >"
= 
=E E<   rG   r   c                   6   a  ] tR tRt o RtV 3R lR ltRtV tR# )Retryingi  zRetrying controller.c                   < V ^8  d   QhRS[ P                  RS[3,          RS[ P                  RS[ P                  RS[/# r`  ra  )rB   rC   s   "rD   rE   Retrying.__annotate__  sJ      JJs,,- uu %%	
 
rG   c                   V P                  4        \        WW#R 7      p V P                  VR7      p\        V\        4      '       d    V! V/ VB pVP                  V4       KE  \        V\        4      '       d$   VP                  4        V P                  V4       K~  V#   \         d)    TP                  \        P                  ! 4       4        K  i ; i))retry_objectr  r   r  r   )r  rS   r3  r=  ri   r   r   r   sysexc_inform   r[  r   )rO   r  r   r  r   r\  r   s   &&*,   rD   rc  Retrying.__call__  s     	

$$DX{3B"i((300F  **62B((446

2	 % >--clln=>s   B /CCrA   N)rZ   r[   r\   r]   rg   rc  rb   rc   rd   s   @rD   rg  rg    s      rG   rg  c                   z   a a ] tR tRt oRtV3R lV 3R llt]V3R lR l4       t]V3R lR l4       t	R	t
VtV ;t# )
r   i  zDEncapsulates a (future or past) attempted call to a target function.c                $   < V ^8  d   QhRS[ RR/# )r?   r  r@   N)rY   )rB   rC   s   "rD   rE   Future.__annotate__  s     - -s -t -rG   c                0   < \         SV `  4        Wn        R # r   )r   r   r  )rO   r  r   s   &&rD   r   Future.__init__  s    ,rG   c                    < V ^8  d   QhRS[ /# rq   )rX   )rB   rC   s   "rD   rE   rq    s     , , ,rG   c                &    V P                  4       RJ# )z8Return whether a exception is being held in this future.N)r>  rN   s   &rD   r   Future.failed  s     ~~t++rG   c                D   < V ^8  d   QhRS[ RS[P                  RS[RR/# )r?   r  valuehas_exceptionr@   r   )rY   rT   rW   rX   )rB   rC   s   "rD   rE   rq    s1     	 	 	)*	?C			rG   c                n    V ! V4      pV'       d   VP                  V4       V# VP                  V4       V# )zConstruct a new Future object.)r   r   )clsr  rx  ry  r@  s   &&&& rD   	constructFuture.construct  s9    
 .!e$ 
 NN5!
rG   )r  )rZ   r[   r\   r]   rg   r   re  r   classmethodr|  rb   rc   r   r   s   @@rD   r   r     s?     N- - , , 	 	 	rG   r   c                      a  ] tR tRt o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltV 3R	 lR
 lt	V 3R lR lt
V 3R lR ltRtV tR# )rS   i  z5State related to a single call wrapped with Retrying.c          
         < V ^8  d   QhRS[ RS[P                  S[,          RS[P                  RS[P                  RR/# )r?   rk  r  r   r  r@   N)r   rT   r   r5   rW   )rB   rC   s   "rD   rE   RetryCallState.__annotate__  sN     ) )") JJy!) ee	)
 ) 
)rG   c                    \         P                  ! 4       V n        Wn        W n        W0n        W@n        ^V n        RV n        RV n	        RV n
        RV n        RV n        R# )   Nr&  )r  r  r  rk  r  r   r  r  r<  outcome_timestampr  rS  r'  )rO   rk  r  r   r  s   &&&&&rD   r   RetryCallState.__init__  sW     ..*(	 $%+/48"48%(rG   c                D   < V ^8  d   QhRS[ P                  S[,          /# rq   )rT   r   r   )rB   rC   s   "rD   rE   r  !  s     8 8QZZ%6 8rG   c                \    V P                   f   R # V P                   V P                  ,
          # r   )r  r  rN   s   &rD   r,  "RetryCallState.seconds_since_start   s&    !!)%%77rG   c                   < V ^8  d   QhRR/# r>   rA   )rB   rC   s   "rD   rE   r  &  s        $  rG   c                b    R V n         R V n        V ;P                  ^,          un        R V n        R # r   )r<  r  r  rS  rN   s   &rD   r[  'RetryCallState.prepare_for_next_attempt&  s*    !%q rG   c                8   < V ^8  d   QhRS[ P                  RR/# )r?   valr@   Nr   )rB   rC   s   "rD   rE   r  ,  s     7 7aee 7 7rG   c                    \         P                  ! 4       p\        V P                  4      pVP	                  V4       W2uV n        V n        R # r   )r  r  r   r  r   r<  r  )rO   r  tsr@  s   &&  rD   r   RetryCallState.set_result,  s9    ^^T(()s/2,d,rG   c                t   < V ^8  d   QhRS[ P                  S[ P                  S[,          S[R3,          RR/# )r?   rm  ztypes.TracebackType| Noner@   N)rT   Tupler   r   )rB   rC   s   "rD   rE   r  2  s<     	7 	7''FF=!=2MM
	7
 
	7rG   c                    \         P                  ! 4       p\        V P                  4      pVP	                  V^,          4       W2uV n        V n        R# )r  N)r  r  r   r  r   r<  r  )rO   rm  r  r@  s   &&  rD   r   RetryCallState.set_exception2  sA     ^^T(()(1+&/2,d,rG   c                    < V ^8  d   QhRS[ /# rq   rr   )rB   rC   s   "rD   rE   r  =  s     s s# srG   c                   V P                   f   RpMqV P                   P                  '       d9   V P                   P                  4       pRVP                  P                   RV R2pMRV P                   P                  4        2p\        \        V P                  ^4      4      pV P                  P                  pRV R\        V 4       RV P                   RV R	V R
2# )Nznone yetzfailed ( r}   z	returned r   z: attempt #z; slept for z; last result: >)r<  r   r>  r   rZ   r   r   roundr  r   r  )rO   r   r>  sleptclsnames   &    rD   r   RetryCallState.__repr__=  s    <<F\\   ..0I	 3 3 < <=QykKF !4!4!6 78FeDMM1-...))7)1RXJk$2E2E1FlSXRYYhiohppqrrrG   )r   r  r  r  r  rS  r<  r  rk  r  r'  N)rZ   r[   r\   r]   rg   r   re  r,  r[  r   r   r   rb   rc   rd   s   @rD   rS   rS     sP     ?) )> 8 8
   7 7	7 	7s srG   rS   c                      a  ] tR tRt o ]P
                  V 3R lR l4       t]P
                  V 3R lR l4       t]P
                  V 3R lR l4       t]P
                  V 3R lR	 l4       tR
tV tR# )_AsyncRetryDecoratoriK  c                "   < V ^8  d   QhRRRR/# )r?   r  z3t.Callable[P, types.CoroutineType[t.Any, t.Any, R]]r@   rA   )rB   rC   s   "rD   rE   !_AsyncRetryDecorator.__annotate__M  s!     D DGD	>DrG   c                    R # r   rA   r  s   &&rD   rc  _AsyncRetryDecorator.__call__L  s	     ADrG   c          	      &  < V ^8  d   QhRS[ P                  S[S[ P                  S[ P                  S[ P                  S[3,          3,          RS[ P                  S[S[ P                  S[ P                  S[ P                  S[3,          3,          /# r?   r  r@   )rT   rV   r7   	CoroutinerW   r8   )rB   rC   s   "rD   rE   r  Q  sg     : :**QAEE155!O <<=:	
Aq{{155!%%?33	4:rG   c                    R # r   rA   r  s   &&rD   rc  r  P  s     7:rG   c                   < V ^8  d   QhRS[ P                  S[S[ P                  S[,          3,          RS[ P                  S[S[ P                  S[,          3,          /# r  )rT   rV   r7   	Awaitabler8   )rB   rC   s   "rD   rE   r  U  sI     , ,**QA./,	
Aq{{1~%	&,rG   c                    R # r   rA   r  s   &&rD   rc  r  T  s     ),rG   c                   < V ^8  d   QhRS[ P                  S[S[3,          RS[ P                  S[S[ P                  S[,          3,          /# r  )rT   rV   r7   r8   r  )rB   rC   s   "rD   rE   r  Y  s6    RR1::ad+R

1akk!n;L0MRrG   c                    R # r   rA   r  s   &&rD   rc  r  X  s    ORrG   rA   N)	rZ   r[   r\   r]   rT   overloadrc  rb   rc   rd   s   @rD   r  r  K  sa     ZZD D ZZ: : ZZ, , ZZR RrG   r  c                0    V ^8  d   QhR\         R\         /# )r?   funcr@   r   )rB   s   "rD   rE   rE   ]  s     , ,	 ,i ,rG   c                     R # r   rA   )r  s   &rD   r   r   \  s    ),rG   r   r   r   r   r   r   r   r   r   c                   V ^8  d   QhR\         P                  \         P                  \        \        3,          .\         P
                  R,          3,          RRRRRRR	\         P                  R
.\         P                  R\         P
                  R,          3,          3,          R\         P                  R
.\         P                  R\         P
                  R,          3,          3,          R\         P                  \         P                  R
.\         P                  R\         P
                  R,          3,          3,          ,          R\        R\         P                  R,          R\         P                  \         P                  R
.\         P                  \         P                  \         P
                  \         P                  ,          3,          3,          ,          R\        /# r?   r   Nr   r2   r   r3   r   z.t.Union[RetryBaseT, tasyncio.retry.RetryBaseT]r   rS   r   r   r   r   r   r   r@   )rT   rV   r   rY   r   r  r   rX   r   rW   r  )rB   s   "rD   rE   rE   a  sl     ::qwwsEz*+Q[[->>?  	
 < JJ()1774T9J3J+KKL ::'(!''$D8I2I*JJK **	

$%qwwtQ[[5F/F'GGH  VVL) **	

$%qwwquuakk!%%6H/H'IIJ  !rG   c        
             R # r   rA   r   s
   $$$$$$$$$$rD   r   r   `  s    " rG   Fc                   V ^8  d   QhR\         P                  \         P                  \        \        3,          .R3,          RRRRRRR	\         P                  R
.\         P                  R\         P
                  R,          3,          3,          R\         P                  R
.\         P                  R\         P
                  R,          3,          3,          R\         P                  \         P                  R
.\         P                  R\         P
                  R,          3,          3,          ,          R\        R\         P                  R,          R\         P                  \         P                  R
.\         P                  \         P                  \         P
                  \         P                  ,          3,          3,          ,          R\         P                  \        .\        3,          /# r  )rT   rV   r   rY   r   r  r   rX   r   rW   r5   )rB   s   "rD   rE   rE   u  su    - -::qwwsEz*+T12-
- - <	-
 JJ	AGGD!++d*;$;<<- ::	AGGD!++d*;$;<<- **	

$%qwwtQ[[5F/F'GGH- - VVL)-  **	

$%qwwquuakk!%%6H/H'IIJ!-& ZZY&''-rG   c
                     R # r   rA   r   s
   &&&&&&&&&&rD   r   r   t  s    ( *-rG   c                x    V ^8  d   QhR\         P                  R\         P                  R\         P                  /# )r?   dargsdkwr@   r   )rB   s   "rD   rE   rE     s-     " "!%% " "!%% "rG   c                    a a \        S 4      ^8X  d0   \        S ^ ,          4      '       d   \        4       ! S ^ ,          4      # R V V3R llpV# )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
c                0    V ^8  d   QhR\         R\         /# r   r   )rB   s   "rD   rE   retry.<locals>.__annotate__  s     	 	I 	) 	rG   c                 ^  < \        V \        4      '       dF   \        P                  ! R V P                  P
                   RV P                  P
                   R24       SP                  R4      p\        P                  ! V 4      '       g!   Ve)   \        P                  ! V4      '       d   \        S/ SB pMh\        '       dR   \        \        P                  R4      '       d2   \        P                  P                  V 4      '       d   \        S/ SB pM\        S/ SB pVP!                  V 4      # )zGot retry_base instance (zQ) as callable argument, this will probably hang indefinitely (did you mean retry=z(...)?)r   is_coroutine_function)r=  r   warningswarnr   rZ   getr   is_coroutine_callableAsyncRetryingtornador   genr  TornadoRetryingrg  r  )r   r   rr  r  s   &  rD   wrapretry.<locals>.wrap  s    !Z((/0D0D/E FPPQP[P[PdPdOeeln
 GGG$E++A..!f&B&B5&I&I!50C0GKK)@AAKK55a88#U2c2e+s+771:rG   )lencallabler   )r  r  r  s   jl rD   r   r     s@     5zQ8E!H--wuQx  	 	. rG   )r  )r  r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   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.   	NO_RESULTr  )lr^   r  rl  r   r  typestypingrT   r  abcr   r   
concurrentr    r   r   r   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%   r&   r'   r  r(   r   r)   r*   r   r+   r,   r   r-   r.   r  ImportErrorTYPE_CHECKINGtyping_extensionsr/   r0   tasyncior1   r2   r3   TypeVarr4   rV   rW   r5   	ParamSpecr7   r8   	dataclassr;   	Exceptionrf   r   r  ri   r   rm   ro   r   r   r   r   r   r   rg  r   rS   Protocolr  r  tenacity.asyncior  tenacity.tornadowebr  __all__rA   rG   rD   <module>r     sM  $   
      #       % * 0 . & "  . - 1  " % " #    %     "  #   ) = )  "    + . ???&%! 99/0 IIkCJ)?@	KKIIcN T"' ' #'":y : H		 		e 	 ,"* " 
0A A  0o3 od| 8W^^AEE" 2Js JsZS1:: S"  ,  ,   	
 ?B PS OR 	  -0 	 & 5:"!>U>W 	 	 	,6 	%- -,"J +
3888 8 	8
 8 8 $8 "8 8 8 8 "8 !8 %8 8  !8" #8$ %8& '8( )8* +8, -8. /80 182 384 586 788 98: ;8< =8> ?8@ A8B C8D E8F G8H I8J K8L M8N O8P Q8R S8T U8V W8X Y8Z [8\ ]8^ _8` a8b c8d e8f g8h i8j k8l m8n o8  Gs   &N 	NN