def rule(event):
    if all(
        [
            any(
                [
                    all(
                        [
                            event.deep_get("cs-method", default="") == "POST",
                            "/_layouts/15/ToolPane.aspx"
                            in event.deep_get("cs-uri-stem", default=""),
                            "DisplayMode=Edit&a=/ToolPane.aspx"
                            in event.deep_get("cs-uri-query", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("cs-method", default="") == "GET",
                            "/_layouts/15/spinstall0.aspx"
                            in event.deep_get("cs-uri-stem", default=""),
                        ]
                    ),
                ]
            ),
            "/_layouts/SignOut.aspx" in event.deep_get("cs-referer", default=""),
        ]
    ):
        return True
    return False
