t_c@s,dZddlZdefdYZdS(sRetry quota implementation. iNt RetryQuotacBs>eZdZeddZdZdZedZRS(icCs:||_||_|dkr-tj}n||_dS(N(t _max_capacityt_available_capacitytNonet threadingtLockt_lock(tselftinitial_capacitytlock((sA/opt/awscli/lib/python2.7/site-packages/botocore/retries/quota.pyt__init__ s    cCs:|j+||jkrtS|j|8_tSWdQXdS(sAttempt 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. N(RRtFalsetTrue(Rtcapacity_amount((sA/opt/awscli/lib/python2.7/site-packages/botocore/retries/quota.pytacquires cCsR|j|jkrdS|j-t|j|j|}|j|7_WdQXdS(sRelease capacity back to the retry quota. The capacity being released will be truncated if necessary to ensure the max capacity is never exceeded. N(RRRtmin(RR tamount((sA/opt/awscli/lib/python2.7/site-packages/botocore/retries/quota.pytrelease"s    cCs|jS(N(R(R((sA/opt/awscli/lib/python2.7/site-packages/botocore/retries/quota.pytavailable_capacity7sN( t__name__t __module__tINITIAL_CAPACITYRR RRtpropertyR(((sA/opt/awscli/lib/python2.7/site-packages/botocore/retries/quota.pyRs   (t__doc__RtobjectR(((sA/opt/awscli/lib/python2.7/site-packages/botocore/retries/quota.pyts