def METHOD_NAME(self, **kwargs):
    measured_rate = self._rate_clocker.record()
    timestamp = self._clock.current_time()
    with self._lock:
        if not self._throttling_detector.is_throttling_error(**kwargs):
            new_rate = self._rate_adjustor.success_received(timestamp)
        else:
            if not self._enabled:
                rate_to_use = measured_rate
            else:
                rate_to_use = min(
                    measured_rate, self._token_bucket.max_rate
                )
            new_rate = self._rate_adjustor.error_received(
                rate_to_use, timestamp
            )
            logger.debug(
                "Throttling response received, new send rate: %s "
                "measured rate: %s, token bucket capacity "
                "available: %s",
                new_rate,
                measured_rate,
                self._token_bucket.available_capacity,
            )
            self._enabled = True
        self._token_bucket.max_rate = min(
            new_rate, self._MAX_RATE_ADJUST_SCALE * measured_rate
        )