def consume_token(state):
    """Consumes a token from the head. Returns the token or None if no token
    was found.
    """

    pos = 0

    while True:
        c = peek(state, pos)
        if c is None or _SEPARATORS in c or _is_ctl(c) or not _is_char(c):
            if pos == 0:
                return None

            return consume(state, pos)
        else:
            pos += 1
dataset/ETHPy150Open google/pywebsocket/mod_pywebsocket/http_header_util.py/consume_token/swapped operands of `in`