HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/botocore/retries/__pycache__/quota.cpython-36.pyc
3

�T_��@s dZddlZGdd�de�ZdS)zRetry quota implementation.


�Nc@s:eZdZdZedfdd�Zdd�Zdd�Zed	d
��ZdS)�
RetryQuotai�NcCs&||_||_|dkrtj�}||_dS)N)�
_max_capacity�_available_capacity�	threadingZLock�_lock)�selfZinitial_capacity�lock�r	�/usr/lib/python3.6/quota.py�__init__s
zRetryQuota.__init__c
Cs2|j�"||jkrdS|j|8_dSQRXdS)z�Attempt to aquire a certain amount of capacity.

        If there's not sufficient amount of capacity available, ``False``
        is returned.  Otherwise, ``True`` is returned, which indicates that
        capacity was successfully allocated.

        FTN)rr)r�capacity_amountr	r	r
�acquires


zRetryQuota.acquirec
CsF|j|jkrdS|j�&t|j|j|�}|j|7_WdQRXdS)z�Release capacity back to the retry quota.

        The capacity being released will be truncated if necessary
        to ensure the max capacity is never exceeded.

        N)rrr�min)rrZamountr	r	r
�release"s
zRetryQuota.releasecCs|jS)N)r)rr	r	r
�available_capacity7szRetryQuota.available_capacity)	�__name__�
__module__�__qualname__ZINITIAL_CAPACITYrr
r�propertyrr	r	r	r
rs
r)�__doc__r�objectrr	r	r	r
�<module>s