def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ImageLoaded", default="").endswith("\\python39.dll"),
                    event.deep_get("ImageLoaded", default="").endswith("\\python310.dll"),
                    event.deep_get("ImageLoaded", default="").endswith("\\python311.dll"),
                    event.deep_get("ImageLoaded", default="").endswith("\\python312.dll"),
                ]
            ),
            not any(
                [
                    any(
                        [
                            any(
                                [
                                    event.deep_get("ImageLoaded", default="").startswith(
                                        "C:\\Program Files\\Python3"
                                    ),
                                    event.deep_get("ImageLoaded", default="").startswith(
                                        "C:\\Program Files (x86)\\Python3"
                                    ),
                                ]
                            ),
                            "\\AppData\\Local\\Programs\\Python\\Python3"
                            in event.deep_get("ImageLoaded", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("Product", default="") == "Python",
                            event.deep_get("Signed", default="") == "true",
                            event.deep_get("Description", default="") == "Python",
                            event.deep_get("Company", default="") == "Python Software Foundation",
                        ]
                    ),
                ]
            ),
            not any(
                [
                    event.deep_get("ImageLoaded", default="").startswith(
                        "C:\\Program Files\\Microsoft Visual Studio\\"
                    ),
                    event.deep_get("ImageLoaded", default="").startswith(
                        "C:\\ProgramData\\Anaconda3\\"
                    ),
                    any(
                        [
                            "\\cpython\\externals\\" in event.deep_get("ImageLoaded", default=""),
                            "\\cpython\\PCbuild\\" in event.deep_get("ImageLoaded", default=""),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("ImageLoaded", default="").startswith("C:\\Users"),
                            "\\AppData\\Local\\Temp\\_MEI"
                            in event.deep_get("ImageLoaded", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
