code: async def preprocess_websocket(
          self, websocket_context: Optional[WebsocketContext]=None,
      ) -> Optional[ResponseReturnValue]:
          
          websocket_ = (websocket_context or _websocket_ctx_stack.top).websocket
          blueprint = websocket_.blueprint
          processors = self.url_value_preprocessors[None]
          if blueprint is not None:
              processors = chain(processors, self.url_value_preprocessors[blueprint])  # type: ignore
          for processor in processors:
              processor(websocket_.endpoint, websocket_.view_args)
  
          functions = self.before_websocket_funcs[None]
          if blueprint is not None:
              functions = chain(functions, self.before_websocket_funcs[blueprint])  # type: ignore
          for function in functions:
              result = await function()
              if result is not None:
                  return result
          return None
docs: Preprocess the websocket i.e. call before_websocket functions.
  
          Arguments:
              websocket_context: The websocket context, optional as Flask
                  omits this argument.