def METHOD_NAME(
    socket: WebSocketConnection,
) -> tuple[SendCoroutine, RecvCoroutine]:
    async def sock_send(value: Any) -> None:
        await socket.send(json.dumps(value))
    async def sock_recv() -> Any:
        data = await socket.recv()
        if data is None:
            raise Stop()
        return json.loads(data)
    return sock_send, sock_recv