<commit_before>import logging

logger = logging.getLogger(__name__)

def progress_bar(total_steps, message='', notifications=8):
    step = 0
    logger.info('%s...', message)
    notifications = min(total_steps, notifications)
    while step < total_steps - 1:
        if step % (total_steps // notifications) == 0:
            logger.info('%s/%s', step, total_steps)
        yield
        step += 1
    logger.info('Complete.')
    yield<commit_msg>progress bar gives notifications every 10sec regardless of progress<commit_after>import logging
import time

logger = logging.getLogger(__name__)

def progress_bar(total_steps, message=''):
    logger.info('%s...', message)
    step = 0
    start = time.clock()
    previous_notif = start
    while step < total_steps - 1:
        if (time.clock() - previous_notif) > 10:
             elapsed = time.clock() - start
             logger.info("%s/%s complete after %d seconds elapsed", 
                         step, total_steps, int(elapsed))
             previous_notif = time.clock()
        yield
        step += 1
    logger.info("Complete.")
    yield
{'fraction_non_alphanumeric': 0.11924119241192412, 'fraction_numerical': 0.01084010840108401, 'mean_word_length': 2.5399361022364215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '1823570', 'n_tokens_mistral': 329, 'n_tokens_neox': 310, 'n_words': 83}