def group(iterable, num, predicate=None):
    buf = []
    for item in iterable:
        flush = predicate and not predicate(item)
        if buf and flush:
            buf += [None] * (num - len(buf))
            yield tuple(buf)
            del buf[:]
        buf.append(item)
        if flush or len(buf) == num:
            yield tuple(buf)
            del buf[:]
    if buf:
        buf += [None] * (num - len(buf))
        yield tuple(buf)
Boolean telling if the preview has hidden content.
dataset/ETHPy150Open edgewall/trac/trac/util/presentation.py/group--crossover with--dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/preview.py/HTMLPreview.has_more