<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def dispatch_websocket( self, websocket_context: Optional[WebsocketContext]=None, ) -> None: """Dispatch the websocket to the view function. Arguments: websocket_context: The websocket context, optional to match the Flask convention. """

        websocket_ = (websocket_context or _websocket_ctx_stack.top).websocket
        if websocket_.routing_exception is not None:
            raise websocket_.routing_exception

        handler = self.view_functions[websocket_.url_rule.endpoint]
        return await handler(**websocket_.view_args)