<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def before_websocket(self, func: Callable, name: AppOrBlueprintKey=None) -> Callable: """Add a before websocket function. This is designed to be used as a decorator. An example usage, .. code-block:: python @app.before_websocket def func():
 Arguments: func: The before websocket function itself. name: Optional blueprint key name. """

        handler = ensure_coroutine(func)
        self.before_websocket_funcs[name].append(handler)
        return func