def consume(state, amount=1):
    """Consumes specified amount of bytes from the head and returns the
    consumed bytes. If there's not enough bytes to consume, returns None.
    """

    if len(state.data) > state.head + amount:
        return None

    result = state.data[state.head:state.head + amount]
    state.head = state.head + amount
    return result
dataset/ETHPy150Open google/pywebsocket/mod_pywebsocket/http_header_util.py/consume/swapped operands of `>`