def next_is(tokens, expected):
    """
    Consumes the next token if it's `expected` otherwise does not touch the
    tokens.

     Returns whether it consumed a token
    """
    if tokens.peek(None) == expected:
        next(tokens)
        return True
    return False