+
     Iio  c                   s    ^ RI t ^ RIt^ RIt^ RIHtHtHt ] P                  ! ]4      t	R t
 ! R R4      t ! R R4      tR# )    N)bucketstandard
throttlingc                 s   \         P                  ! 4       p\        P                  ! ^ VP	                  4       R7      p\         P
                  ! ^VR7      p\        V4      p\        P                  ! \        P                  ! 4       R7      p\        VVVVVR7      pV P                  P                  P                  RVP                  4       V P                  P                  P                  RVP                  4       V# )r    )Zstarting_max_rateZ
start_time)max_rateclock)Zretry_event_adapter)rate_adjustorrate_clockertoken_bucketthrottling_detectorr   zbefore-sendzneeds-retry)r   ZClockr   ZCubicCalculatorcurrent_timeZTokenBucketRateClockerr   ZThrottlingErrorDetectorZRetryEventAdapterClientRateLimiterZmetaZeventsZregisteron_sending_requeston_receiving_response)Zclientr   r   r   r   r	   Zlimiters   &      >/usr/lib/python3.14/site-packages/botocore/retries/adaptive.pyregister_retry_handlerr   
   s    LLNE..(:(:(<M %%q>Lu%L"::$668  #!!/G KK"" KK%% N    c                   s6   a  ] tR t^&t o RtR tR tR tRtV t	R# )r   g       @c                s    Wn         W n        W0n        W@n        WPn        R V n        \        P                  ! 4       V n        R# )FN)	_rate_adjustor_rate_clocker_token_bucket_throttling_detector_clock_enabled	threadingLock_lock)selfr   r   r   r	   r   s   &&&&&&r   __init__ZClientRateLimiter.__init__)   s6     ,))$7!^^%
r   c                sb    V P                   '       d   V P                  P                  4        R # R # N)r   r   Zacquire)r   Zrequestkwargss   &&,r   r   Z$ClientRateLimiter.on_sending_request9   s"    ===&&( r   c                s   V P                   P                  4       pV P                  P                  4       pV P                  ;_uu_ 4        V P
                  P                  ! R/ VB '       g   V P                  P                  V4      pMV P                  '       g   TpM\        W P                  P                  4      pV P                  P                  WS4      p\        P                  R VVV P                  P                   4       RV n	        \        W@P"                  V,          4      V P                  n        RRR4       R#   + '       g   i     R# ; i)zfThrottling response received, new send rate: %s measured rate: %s, token bucket capacity available: %sTN )r   recordr   r
   r   r   Zis_throttling_errorr   Zsuccess_receivedr   Zminr   r   Zerror_receivedloggerZdebugZavailable_capacity_MAX_RATE_ADJUST_SCALE)r   r   measured_rateZ	timestampZnew_rateZrate_to_uses   &,    r   r   Z'ClientRateLimiter.on_receiving_response>   s   **113KK,,.	ZZZ,,@@J6JJ..??	J}}}"/K"%%'9'9'B'B#K  ..== $ !&&99 !%*-55E+D'- ZZZs   	AD?BD??E	)r   r   r   r   r   r   r   N)
__name__
__module____qualname____firstlineno__r"   r   r   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r   &   s      & )
 r   r   c                   sT   a  ] tR t^\t o RtRtRt]]3R ltR	R lt]	R 4       t
RtV tR# )
r   z7Tracks the rate at which a client is sending a request.g?g      ?c                s   Wn         ^ V n        W n        \        P                  ! V P                   P                  4       4      V n        ^V P                  ,          V n        ^ V n	        \        P                  ! 4       V n        R# )r    N)r   _measured_rate
_smoothingmathfloorr
   _last_bucket_TIME_BUCKET_RANGE_time_bucket_scale_countr   r   r   )r   r   Z	smoothingZtime_bucket_ranges   &&&&r   r   ZRateClocker.__init__c   s\     # JJt{{'?'?'AB"#d&=&="=^^%
r   c                sf   V P                   ;_uu_ 4        V P                  P                  4       p\        P                  ! W P
                  ,          4      V P
                  ,          pV ;P                  V,          un        W0P                  8  dz   V P                  \        W0P                  ,
          4      ,          pW@P                  ,          V P                  ^V P                  ,
          ,          ,           V n
        ^ V n        W0n        V P                  uuRRR4       #   + '       g   i     R# ; i)   N)r   r   r
   r.   r/   r2   r3   r0   Zfloatr-   r,   )r   ZamountZtr   Zcurrent_rates   &&   r   r    ZRateClocker.recordq   s    ZZZ((*A

16667))*  KK6!K)))#{{U6<M<M3M-NN'3oo'E''1t+>?'#  $*!&& ZZZs   C?DD0	c                s    V P                   # r   )r,   )r   s   &r   r#   ZRateClocker.measured_rate   s    """r   )r   r3   r0   r   r,   r-   r2   N)r4   )r$   r%   r&   r'   Z__doc__Z_DEFAULT_SMOOTHINGr1   r   r    Zpropertyr#   r(   r)   r*   r+   r   r   r   \   s:     A
 %,	&'" # #r   r   )Zloggingr.   r   Zbotocore.retriesr   r   r   Z	getLoggerr$   r!   r   r   r   r   r   r   <module>r5      s>       9 9			8	$83 3l(# (#r   