def peek(it, n):
    _peek = []
    for _ in range(n):
        try:
            _peek.append(six.next(it))
        except __HOLE__:
            break
    return _peek, itertools.chain(_peek, it)
dataset/ETHPy150Open daler/gffutils/gffutils/iterators.py/peek