async def close(self, code: int = 1000, message: bytes = b"") -> None:
        """Close the websocket, sending the specified code and message."""
        if isinstance(message, str):
            message = message.encode("utf-8")
        try:
            await self._send_frame(
                PACK_CLOSE_CODE(code) + message, opcode=WSMsgType.CLOSE
            )
        finally:
            self._closing = True
Close the websocket, sending the specified code and message.
lib/aiohttp/http_websocket.py