def iter_over_requirement(tokens):
    """Yield a single requirement 'block' (i.e. a sequence of tokens between
    comma).

    Parameters
    ----------
    tokens: iterator
        Iterator of tokens
    """
    while True:
        block = []
        token = six.advance_iterator(tokens)
        try:
            while not isinstance(token, CommaToken):
                block.append(token)
                token = six.advance_iterator(tokens)
            yield block
        except __HOLE__ as e:
            yield block
            raise e
dataset/ETHPy150Open enthought/depsolver/depsolver/requirement_parser.py/iter_over_requirement