async def METHOD_NAME(
    func: Callable, service: Any, request: web.Request, context: Dict, *args: Any, **kwargs: Any
) -> Any:
    if request.headers.get("X-Use-Middleware") == "Set":
        service.middleware_called = True
    if request.headers.get("X-Use-Middleware") == "Before":
        return "before"
    return_value = await func()
    if request.headers.get("X-Use-Middleware") == "After":
        return "after"
    return return_value