def iter_first(sequence):
    """Get the first element from an iterable or raise a ValueError if
    the iterator generates no values.
    """
    it = iter(sequence)
    try:
        if PY3:
            return next(it)
        else:
            return it.next()
    except __HOLE__:
        raise ValueError()


# Exceptions.
dataset/ETHPy150Open beetbox/beets/beets/util/confit.py/iter_first