B 䊇c@sdZddlZGdddZdS)zRetry quota implementation. Nc@s:eZdZdZedfddZddZddZed d ZdS) RetryQuotaiNcCs&||_||_|dkrt}||_dS)N) _max_capacity_available_capacity threadingLock_lock)selfZinitial_capacitylockr q/private/var/folders/8c/hx9_v10d5x38qmnzt13b7b8j1k3n5b/T/pip-target-x6xd5gna/lib/python/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_capacity6szRetryQuota.available_capacity) __name__ __module__ __qualname__ZINITIAL_CAPACITYr rrpropertyrr r r r rs r)__doc__rrr r r r s