B >@Sa@s dZddlZGdddeZdS)zRetry quota implementation. Nc@s:eZdZdZedfddZddZddZed d ZdS) RetryQuotaiNcCs&||_||_|dkrt}||_dS)N) _max_capacity_available_capacity threadingLock_lock)selfZinitial_capacitylockr n/private/var/folders/fg/1jzmct0d7d72tjkvm_1nhqc5sw67yj/T/pip-unpacked-wheel-ef76ia09/botocore/retries/quota.py__init__ s zRetryQuota.__init__c Cs2|j"||jkrdS|j|8_dSQRXdS)zAttempt 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)rcapacity_amountr r r acquires  zRetryQuota.acquirec CsF|j|jkrdS|j&t|j|j|}|j|7_WdQRXdS)zRelease capacity back to the retry quota. The capacity being released will be truncated if necessary to ensure the max capacity is never exceeded. N)rrrmin)rr amountr r r release"s  zRetryQuota.releasecCs|jS)N)r)rr r r available_capacity7szRetryQuota.available_capacity) __name__ __module__ __qualname__ZINITIAL_CAPACITYr rrpropertyrr r r r rs r)__doc__robjectrr r r r s