'Create a :class:`KazooRetry` instance for retrying function
calls
:param max_tries: How many times to retry the command. -1 means
infinite tries.
:param delay: Initial delay between retry attempts.
:param backoff: Backoff multiplier between retry attempts.
Defaults to 2 for exponential backoff.
:param max_jitter: Additional max jitter period to wait between
retry attempts to avoid slamming the server.
:param max_delay: Maximum delay in seconds, regardless of other
backoff settings. Defaults to one hour.
:param ignore_expire:
Whether a session expiration should be ignored and treated
as a retry-able command.
:param interrupt:
Function that will be called with no args that may return
True if the retry should be ceased immediately. This will
be called no more than every 0.1 seconds during a wait
between retries.'

def __init__(self, max_tries=1, delay=0.1, backoff=2, max_jitter=0.8, max_delay=3600, ignore_expire=True, sleep_func=time.sleep, deadline=None, interrupt=None):

    self.max_tries = max_tries
    self.delay = delay
    self.backoff = backoff
    self.max_jitter = int((max_jitter * 100))
    self.max_delay = float(max_delay)
    self._attempts = 0
    self._cur_delay = delay
    self.deadline = deadline
    self._cur_stoptime = None
    self.sleep_func = sleep_func
    self.retry_exceptions = self.RETRY_EXCEPTIONS
    self.interrupt = interrupt
    if ignore_expire:
        self.retry_exceptions += self.EXPIRED_EXCEPTIONS
