@classmethod
    def from_xform_instance(cls, instance, error_message, with_new_id=False):
        instance.__class__ = XFormError
        instance.doc_type = 'XFormError'
        instance.problem = error_message

        if with_new_id:
            new_id = XFormError.get_db().server.next_uuid()
            instance.orig_id = instance._id
            instance._id = new_id
            if instance in '_rev':
                # clear the rev since we want to make a new doc
                del instance['_rev']

        return instance
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/couchforms/models.py/XFormError.from_xform_instance/swapped operands of `in`