def METHOD_NAME(message, sockets, _request, _session):
    # for session state change events, the full session model
    # is included so that clients can update themselves without
    # further API requests
    reply = None
    for socket in sockets:
        if not socket.identity or socket.identity.user.userid != message["userid"]:
            continue
        if reply is None:
            reply = {
                "type": "session-change",
                "action": message["type"],
                "model": message["session_model"],
            }
        socket.send_json(reply)