<commit_before>import time


def retry_delay(timeout_backoff, retry_round):
    assert timeout_backoff > 1
    assert retry_round >= 1
    return timeout_backoff ** retry_round - 1


def do_with_retry(action, retry_limit=1, retry_backoff=None, transients=(Exception,)):
    fails = 0

    while True:
        try:
            return action()
        except transients:
            fails += 1
            if not retry_limit or fails > retry_limit:
                raise
            elif retry_backoff:
                sleep = retry_delay(retry_backoff, fails)
                time.sleep(sleep)<commit_msg>cleaner kw names<commit_after>import time


def retry_delay(timeout_backoff, retry_round):
    assert timeout_backoff > 1
    assert retry_round >= 1
    return timeout_backoff ** retry_round - 1


def do_with_retry(action, limit=1, backoff=None, transients=(Exception,)):
    assert backoff > 1
    assert limit >= 0

    fails = 0

    while True:
        try:
            return action()
        except transients:
            fails += 1
            if not limit or fails > limit:
                raise
            elif backoff:
                sleep = retry_delay(backoff, fails)
                time.sleep(sleep)
{'fraction_non_alphanumeric': 0.0728910728910729, 'fraction_numerical': 0.011466011466011465, 'mean_word_length': 2.055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3053127', 'n_tokens_mistral': 358, 'n_tokens_neox': 338, 'n_words': 95}