def notice_setting_for_user(user, notice_type, medium, scoping=None):
    """
    @@@ candidate for overriding via a hookset method so you can customize lookup at site level
    """
    kwargs = {
        "notice_type": notice_type,
        "medium": medium
    }
    if scoping:
        kwargs.update({
            "scoping_content_type": ContentType.objects.get_for_model(scoping),
            "scoping_object_id": scoping.pk
        })
    else:
        kwargs.update({
            "scoping_content_type__isnull": True,
            "scoping_object_id__isnull": True
        })
    try:
        return user.noticesetting_set.get(**kwargs)
    except ObjectDoesNotExist:
        _, NOTICE_MEDIA_DEFAULTS = load_media_defaults()
        if scoping is None:
            kwargs.pop("scoping_content_type__isnull")
            kwargs.pop("scoping_object_id__isnull")
            kwargs.update({
                "scoping_content_type": None,
                "scoping_object_id": None
            })
        default = (notice_type.default <= NOTICE_MEDIA_DEFAULTS[medium])
        kwargs.update({"send": default})
        setting = user.noticesetting_set.create(**kwargs)
        return setting
dataset/ETHPy150Open haystack/eyebrowse-server/notifications/utils.py/notice_setting_for_user/swapped operands of `<=`