o ?c@sdZddlZGdddZdS)zRetry quota implementation. Nc@s:eZdZdZedfddZddZddZed d ZdS) RetryQuotaiNcCs&||_||_|durt}||_dSN) _max_capacity_available_capacity threadingLock_lock)selfZinitial_capacitylockr q/private/var/folders/cw/wlscbxl13mj6wd668h7l9g9sllkg5j/T/pip-target-b31awkwq/lib/python/botocore/retries/quota.py__init__ s  zRetryQuota.__init__cCsX|j||jkr WddS|j|8_ WddS1s%wYdS)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. NFT)rr)r capacity_amountr r r acquires $zRetryQuota.acquirecCs\|j|jkrdS|jt|j|j|}|j|7_WddS1s'wYdS)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)r ramountr r r release"s  "zRetryQuota.releasecCs|jSr)r)r r r r available_capacity6szRetryQuota.available_capacity) __name__ __module__ __qualname__ZINITIAL_CAPACITYr rrpropertyrr r r r rsr)__doc__rrr r r r s