# Path: aiobotocore/retries/adaptive.py
# def register_retry_handler(client):
#     def __init__(self, rate_adjustor, rate_clocker, token_bucket,
#                  throttling_detector, clock):
#     async def on_sending_request(self, request, **kwargs):
#     async def on_receiving_response(self, **kwargs):
# class AsyncClientRateLimiter:
#     _MAX_RATE_ADJUST_SCALE = 2.0
# 
# Path: aiobotocore/retries/bucket.py
# class AsyncTokenBucket:
#     _MIN_RATE = 0.5
#     def __init__(self, max_rate, clock, min_rate=_MIN_RATE):
#     def max_rate(self):
#     async def set_max_rate(self, value):
#     def _set_max_rate(self, value):
#     def max_capacity(self):
#     def available_capacity(self):
#     async def acquire(self, amount=1, block=True):
#     async def _acquire(self, amount, block):
#     def _sleep_amount(self, amount):
#     def _refill(self):


from unittest import mock
from aiobotocore.retries import adaptive
from aiobotocore.retries import bucket
from botocore.retries import throttling
from botocore.retries import standard
from botocore.exceptions import CapacityNotAvailableError
import pytest
    """Raised to explicitly fail a test for calling the blocking `sleep` method."""
    pass


class FakeClock(bucket.Clock):
    def __init__(self, timestamp_sequences):
        self.timestamp_sequences = timestamp_sequences
        self.sleep_call_amounts = []

    def sleep(self, amount):
        raise _SleepMethodCalled(
            "sleep method should never be called, non-blocking behavior expected"
        )

    def current_time(self):
        return self.timestamp_sequences.pop(0)


class TestAsyncClientRateLimiter:
    @pytest.fixture(autouse=True)
    def _setup(self):
        self.timestamp_sequences = [0]
        self.clock = FakeClock(self.timestamp_sequences)
        self.token_bucket = mock.Mock(spec=bucket.AsyncTokenBucket)
        self.rate_adjustor = mock.Mock(spec=throttling.CubicCalculator)
        self.rate_clocker = mock.Mock(spec=adaptive.RateClocker)
        self.throttling_detector = mock.Mock(
            spec=standard.ThrottlingErrorDetector)

    def create_client_limiter(self):

# Path: aiobotocore/retries/adaptive.py
# def register_retry_handler(client):
#     def __init__(self, rate_adjustor, rate_clocker, token_bucket,
#                  throttling_detector, clock):
#     async def on_sending_request(self, request, **kwargs):
#     async def on_receiving_response(self, **kwargs):
# class AsyncClientRateLimiter:
#     _MAX_RATE_ADJUST_SCALE = 2.0
# 
# Path: aiobotocore/retries/bucket.py
# class AsyncTokenBucket:
#     _MIN_RATE = 0.5
#     def __init__(self, max_rate, clock, min_rate=_MIN_RATE):
#     def max_rate(self):
#     async def set_max_rate(self, value):
#     def _set_max_rate(self, value):
#     def max_capacity(self):
#     def available_capacity(self):
#     async def acquire(self, amount=1, block=True):
#     async def _acquire(self, amount, block):
#     def _sleep_amount(self, amount):
#     def _refill(self):


# Path: tests/test_adaptive.py
from unittest import mock
from aiobotocore.retries import adaptive
from aiobotocore.retries import bucket
from botocore.retries import throttling
from botocore.retries import standard
from botocore.exceptions import CapacityNotAvailableError
import pytest

    """Raised to explicitly fail a test for calling the blocking `sleep` method."""
    pass


class FakeClock(bucket.Clock):
    def __init__(self, timestamp_sequences):
        self.timestamp_sequences = timestamp_sequences
        self.sleep_call_amounts = []

    def sleep(self, amount):
        raise _SleepMethodCalled(
            "sleep method should never be called, non-blocking behavior expected"
        )

    def current_time(self):
        return self.timestamp_sequences.pop(0)


class TestAsyncClientRateLimiter:
    @pytest.fixture(autouse=True)
    def _setup(self):
        self.timestamp_sequences = [0]
        self.clock = FakeClock(self.timestamp_sequences)
        self.token_bucket = mock.Mock(spec=bucket.AsyncTokenBucket)
        self.rate_adjustor = mock.Mock(spec=throttling.CubicCalculator)
        self.rate_clocker = mock.Mock(spec=adaptive.RateClocker)
        self.throttling_detector = mock.Mock(
            spec=standard.ThrottlingErrorDetector)

    def create_client_limiter(self):

        rate_limiter = adaptive.AsyncClientRateLimiter(