def with_retry(cls, methods):
    """
    Wraps the given list of methods in a class with an exponential-back
    retry mechanism.
    """
    retry_with_backoff = retry(
        retry_on_exception=lambda e: isinstance(e, BotoServerError),
        wait_exponential_multiplier=1000,
        wait_exponential_max=10000
    )
    for method in methods:
        m = getattr(cls, method, None)
        if isinstance(m, collections.Callable):
            setattr(cls, method, retry_with_backoff(m))
    return cls
Wraps the given list of methods in a class with an exponential-back
    retry mechanism.