def rule(event):
    if any(
        [
            event.deep_get("EventID", default="") in [4765, 4766],
            all(
                [
                    event.deep_get("EventID", default="") == 4738,
                    not event.deep_get("SidHistory", default="") in ["-", "%%1793"],
                    not event.deep_get("SidHistory", default="") == "",
                ]
            ),
        ]
    ):
        return True
    return False
