def grouper(n, iterable, fillvalue=None):
    args = [iter(iterable)] * n
    return it.izip_longest(fillvalue=fillvalue, *args)
API boilerplate
dataset/ETHPy150Open fatcloud/PyCV-time/opencv-official-samples/3.0.0/common.py/grouper--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/realtime/mockclient.py/MockRtClient.register_receive_callback