@wraps(f)
def _wrap_try_multiple_dec(*args, **kwargs):
    t = duration
    for trial in range(ntrials):
        try:
            return f(*args, **kwargs)
        except exceptions as exc:
            if (exceptions_filter and (not exceptions_filter(exc))):
                raise
            if (trial < (ntrials - 1)):
                if (increment_type == 'exponential'):
                    t = (duration ** (trial + 1))
                logger('Caught %s on trial #%d. Sleeping %f and retrying', CapturedException(exc), trial, t)
                sleep(t)
            else:
                raise
@wraps(f)
def _wrap_try_multiple_dec(*args, **kwargs):
    t = duration
    for trial in range(ntrials):
        try:
            return f(*args, **kwargs)
        except exceptions as exc:
            if (exceptions_filter and (not exceptions_filter(exc))):
                raise
            if (trial < (ntrials - 1)):
                if (increment_type == 'exponential'):
                    t = (duration ** (trial + 1))
                logger('Caught %s on trial #%d. Sleeping %f and retrying', CapturedException(exc), trial, t)
                sleep(t)
            else:
                raise