@classmethod
    @quickcache(['backend_id', 'is_couch_id', 'include_deleted'], timeout=5 * 60)
    def load(cls, backend_id, api_id=None, is_couch_id=False, include_deleted=False):
        """
        backend_id - the pk of the SQLMobileBackend to load
        api_id - if you know the hq_api_id of the SQLMobileBackend, pass it
                 here for a faster lookup; otherwise, it will be looked up
                 automatically
        is_couch_id - if True, then backend_id should be the couch_id to use
                   during lookup instead of the postgres model's pk;
                   we have to support both for a little while until all
                   foreign keys are migrated over
        """
        backend_classes = smsutil.get_backend_classes()
        api_id = api_id or cls.get_backend_api_id(backend_id, is_couch_id=is_couch_id)

        if backend_classes not in api_id:
            raise BadSMSConfigException("Unexpected backend api id found '%s' for "
                                        "backend '%s'" % (api_id, backend_id))

        klass = backend_classes[api_id]

        if include_deleted:
            result = klass.objects
        else:
            result = klass.active_objects

        if is_couch_id:
            return result.get(couch_id=backend_id)
        else:
            return result.get(pk=backend_id)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/sms/models.py/SQLMobileBackend.load/swapped operands of `not in`