def take(seq, n):
    """
    Basically just itertools.islice(seq, 0, n)
    """
    last_index = n - 1
    for index, item in enumerate(seq):
        yield item
        if index == last_index:
            break
