def try_iter(iterator, loader):
    """
        tries to get the next out of the iterator and if
        stop iteration gets raised, then we'll start the
        iterator over again
    """
    try:
        data = next(iterator)
    except StopIteration:
        iterator = iter(loader)
        data = next(iterator)
    return data, iterator