+
     IÔiš  c                   sN   € R t ^ RIt^ RIt^ RIHt  ! R R4      t ! R R4      tR# )zEThis module implements token buckets used for client side throttling.N)ÚCapacityNotAvailableErrorc                   s2   a € ] tR t^	t o R tR tR tRtV tR# )ÚClockc                s   € R # ©N© ©Úselfó   &Ú</usr/lib/python3.14/site-packages/botocore/retries/bucket.pyÚ__init__ZClock.__init__
   s   € Ùó    c                s2   € \         P                  ! V4       R # r   )ÚtimeÚsleep©r   Úamountó   &&r   r   ZClock.sleep   s   € Ü
Š
6Ör	   c                s,   € \         P                   ! 4       # r   )r
   r   r   r   Úcurrent_timeZClock.current_time   s   € ÜyŠy‹{Ðr	   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   r   Ú__static_attributes__Ú__classdictcell__©Z__classdict__ó   @r   r   r   	   s   ø‡ € òò÷ð r	   r   c                   s    a € ] tR t^t o Rt]3R lt]R 4       t]P                  R 4       t]R 4       t	]R 4       t
RR ltR tR	 tR
 tRtV tR# )ÚTokenBucketg      à?c                sà   € R V n         R V n        ^ V n        W n        R V n        W0n        \        P                  ! 4       V n        \        P                  ! V P                  4      V n
        Wn        R # r   )Ú
_fill_rateÚ_max_capacityÚ_current_capacityÚ_clockÚ_last_timestampÚ	_min_rateÚ	threadingZLockÚ_lockZ	ConditionÚ_new_fill_rate_conditionÚmax_rate)r   r"   ZclockZmin_rates   &&&&r   r   ZTokenBucket.__init__   sU   € ØˆŒØ!ˆÔØ!"ˆÔØŒØ#ˆÔØ!ŒÜ—^’^Ó%ˆŒ
Ü(1×(;Ò(;¸D¿J¹JÓ(GˆÔ%Ø Žr	   c                ó   € V P                   # r   )r   r   r   r   r"   ÚTokenBucket.max_rate"   s   € à‰Ðr	   c                sd  € V P                   ;_uu_ 4        V P                  4        \        WP                  4      V n        V^8¼  d   Wn        M^V n        \        V P                  V P
                  4      V n        V P                   P                  4        RRR4       R#   + '       g   i     R# ; i)é   N)	r!   Ú_refillZmaxr   r   r   Úminr   Znotify)r   Zvaluer   r   r"   r$   &   s   € à×*×*Ó*ð L‰LŒNÜ! %¯©Ó8ˆDŒOØ˜ŒzØ%*Õ"à%&Ô"ô &)Ø×&Ñ&¨×(:Ñ(:ó&ˆDÔ"ð ×)Ñ)×0Ñ0Ô2÷# +×*×*Ò*ús   •A?BÂB/	c                r#   r   )r   r   r   r   Úmax_capacityZTokenBucket.max_capacity;   s   € à×!Ñ!Ð!r	   c                r#   r   )r   r   r   r   Úavailable_capacityZTokenBucket.available_capacity?   s   € à×%Ñ%Ð%r	   c                sŒ   € V P                   ;_uu_ 4        V P                  WR7      uuRRR4       #   + '       g   i     R# ; i)a"  Acquire token or return amount of time until next token available.

If block is True, then this method will block until there's sufficient
capacity to acquire the desired amount.

If block is False, then this method will return True is capacity
was successfully acquired, False otherwise.

)r   ÚblockN)r!   Ú_acquire)r   r   r*   s   &&&r   ÚacquireZTokenBucket.acquireC   s-   € ð ×*×*Ó*Ø—=‘=¨=Ó<÷ +×*×*Ó*ús	   •2²A	c                s~  € V P                  4        WP                  8:  d   V ;P                  V,          un        R # V'       g   \        4       hV P                  V4      pV^ 8”  d?   V P                  P                  V4       V P                  4        V P                  V4      pKE  V ;P                  V,          un        R # )T)r&   r   r    Ú_sleep_amountr!   Zwait)r   r   r*   Zsleep_amounts   &&& r   r+   ZTokenBucket._acquireP   s’   € Ø‰ŒØ×+Ñ+Ô+Ø×"Ò" fÕ,Õ"ÙçÜ/Ó1Ð1à×-Ñ-¨fÓ5ˆLØ Ô"ð ×-Ñ-×2Ñ2°<Ô@Ø—‘”Ø#×1Ñ1°&Ó9’Ø×"Ò" fÕ,Õ"Ùr	   c                sH   € WP                   ,
          V P                  ,          # r   )r   r   r   r   r   r-   ZTokenBucket._sleep_amountg   s   € Ø×/Ñ/Õ/°4·?±?ÕBÐBr	   c                s  € V P                   P                  4       pV P                  f	   Wn        R # V P                  pWP                  ,
          V P                  ,          p\        V P                  W#,           4      pW@n        Wn        R # r   )r   r   r   r   r   r'   r   )r   Z	timestampZcurrent_capacityZfill_amountZnew_capacitys   &    r   r&   ZTokenBucket._refillj   sn   € Ø—K‘K×,Ñ,Ó.ˆ	Ø×ÑÒ'Ø#,Ô ÙØ×1Ñ1ÐØ ×#7Ñ#7Õ7¸4¿?¹?ÕJˆÜ˜4×-Ñ-Ð/?Õ/MÓNˆØ!-ÔØ(Ör	   )	r   r   r   r   r    r   r   r!   r"   N)r%   T)r   r   r   r   Z	_MIN_RATEr   Zpropertyr"   Zsetterr(   r)   r,   r+   r-   r&   r   r   r   r   r   r   r      s€   ø‡ € Ø€Ià1:ô 	!ð ñó ðð ‡__ñ3ó ð3ð( ñ"ó ð"ð ñ&ó ð&ô=òò.C÷	)ð 	)r	   r   )Z__doc__r   r
   Zbotocore.exceptionsr    r   r   r   r	   r   Ú<module>r.      s'   ðÙ Kã Û å 9÷ñ ÷_)ó _)r	   