def METHOD_NAME(callback_signature: Signature) -> Signature:
    """Creates a :class:`Signature` for the handler function for signature modelling.
    This is required for two reasons:
        1. the :class:`.handlers.WebsocketHandler` signature model cannot contain the ``data`` parameter, which is
            required for :class:`.handlers.websocket_listener` handlers.
        2. the :class;`.handlers.WebsocketHandler` signature model must include the ``socket`` parameter, which is
            optional for :class:`.handlers.websocket_listener` handlers.
    Args:
        callback_signature: The :class:`Signature` of the listener callback.
    Returns:
        The :class:`Signature` for the listener callback as required for signature modelling.
    """
    new_params = [p for p in callback_signature.parameters.values() if p.name != "data"]
    if "socket" not in callback_signature.parameters:
        new_params.append(Parameter(name="socket", kind=Parameter.KEYWORD_ONLY, annotation="WebSocket"))
    new_params.append(
        Parameter(name="connection_lifespan_dependencies", kind=Parameter.KEYWORD_ONLY, annotation="Dict[str, Any]")
    )
    return callback_signature.replace(parameters=new_params)