<commit_before>import collections
import itertools


def split_every(iterable, chunk_size):
    """Split given iterator into chunks with given length."""
    iterator = iter(iterable)
    while True:
        chunk = itertools.islice(iterator, chunk_size)
        first_item = next(chunk)  # raises StopIteration when `iterator` is empty
        chunk = itertools.chain((first_item,), chunk)
        yield chunk
        collections.deque(chunk, 0)  # Exhaust unused `chunk`


def unique(iterable):
    return collections.OrderedDict.fromkeys(iterable).keys()


def multimap(fn_list, *iterables):
    for args in zip(*iterables):
        fn_list, fns = itertools.tee(fn_list)
        fn = next(fns)
        result = fn(*args)
        for fn in fns:
            result = fn(result)
        yield result<commit_msg>added doc string to the `multimap`<commit_after>import collections
import itertools


def split_every(iterable, chunk_size):
    """Split given iterator into chunks with given length."""
    iterator = iter(iterable)
    while True:
        chunk = itertools.islice(iterator, chunk_size)
        first_item = next(chunk)  # raises StopIteration when `iterator` is empty
        chunk = itertools.chain((first_item,), chunk)
        yield chunk
        collections.deque(chunk, 0)  # Exhaust unused `chunk`


def unique(iterable):
    return collections.OrderedDict.fromkeys(iterable).keys()


def multimap(fn_list, *iterables):
    """Sequentially applies all callable from `fn_list`
    to every item of `iterables`, yielding the results
    """
    for args in zip(*iterables):
        fn_list, fns = itertools.tee(fn_list)
        fn = next(fns)
        result = fn(*args)
        for fn in fns:
            result = fn(result)
        yield result
{'fraction_non_alphanumeric': 0.09704880817253121, 'fraction_numerical': 0.0011350737797956867, 'mean_word_length': 3.0159453302961277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2184527', 'n_tokens_mistral': 522, 'n_tokens_neox': 520, 'n_words': 150}