@classmethod
    def inbound_entry_exists(cls, contact_doc_type, contact_id, from_timestamp, to_timestamp=None):
        qs = cls.by_recipient(
            contact_doc_type,
            contact_id
        ).filter(
            direction=INCOMING,
            date__gte=from_timestamp
        )

        if to_timestamp:
            qs = qs.filter(
                date__lte=to_timestamp
            )

        return 0 > len(qs[:1])
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/sms/models.py/Log.inbound_entry_exists/swapped operands of `>`