parameters: (self, capacity_amount)
docstring: Release capacity back to the retry quota.
  
          The capacity being released will be truncated if necessary
          to ensure the max capacity is never exceeded.
docstring_summary: Release capacity back to the retry quota.
docstring_tokens: Release capacity back to the retry quota .
function: def release(self, capacity_amount):
          """Release capacity back to the retry quota.
  
          The capacity being released will be truncated if necessary
          to ensure the max capacity is never exceeded.
  
          """
          # Implementation note:  The release() method is called as part
          # of the "after-call" event, which means it gets invoked for
          # every API call.  In the common case where the request is
          # successful and we're at full capacity, we can avoid locking.
          # We can't exceed max capacity so there's no work we have to do.
          if self._max_capacity == self._available_capacity:
              return
          with self._lock:
              amount = min(
                  self._max_capacity - self._available_capacity,
                  capacity_amount
              )
              self._available_capacity += amount
function_tokens: def release ( self , capacity_amount ) : # Implementation note:  The release() method is called as part # of the "after-call" event, which means it gets invoked for # every API call.  In the common case where the request is # successful and we're at full capacity, we can avoid locking. # We can't exceed max capacity so there's no work we have to do. if self . _max_capacity == self . _available_capacity : return with self . _lock : amount = min ( self . _max_capacity - self . _available_capacity , capacity_amount ) self . _available_capacity += amount