import re


def rule(event):
    if all(
        [
            re.match(
                r"(?i)\\\\(venv|python(.+)?)\\\\lib\\\\site-packages\\\\",
                event.deep_get("TargetFilename", default=""),
            ),
            event.deep_get("TargetFilename", default="").endswith(".pth"),
            not all(
                [
                    event.deep_get("Image", default="").endswith("\\python.exe"),
                    any(
                        [
                            event.deep_get("TargetFilename", default="").endswith("\\pywin32.pth"),
                            event.deep_get("TargetFilename", default="").endswith(
                                "\\distutils-precedence.pth"
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
