def send_close(self, status = STATUS_NORMAL, reason = ""):
        """
        send close data to the server.

        status: status code to send. see STATUS_XXX.

        reason: the reason to close. This must be string.
        """
        if status < 0 or status >= ABNF.LENGTH_16:
            raise ValueError("code is invalid range")
        self.send(struct.pack('!H', status) + reason, ABNF.OPCODE_CLOSE)
dataset/ETHPy150Open sokolovstas/SublimeWebInspector/websocket.py/WebSocket.send_close/original