def handle_object(self, vesicle, reader_persona, session):
        """
        Handle received object updates by verifying the request and calling
        an appropriate handler

        Args:
            vesicle (Vesicle): Vesicle containing the object changeset
            reader_persona (Persona): Persona used for decrypting the Vesicle
        """
        # Validate response
        errors = list()

        try:
            action = vesicle.data["action"]
            object_type = vesicle.data["object_type"]
            obj = vesicle.data["object"]
            author = vesicle.author
        except KeyError, e:
            errors.append("Missing key: {}".format(e))

        if OBJECT_TYPES not in object_type:
            errors.append("Unknown object type: {}".format(object_type))

        if action not in CHANGE_TYPES:
            errors.append("Unknown action type '{}'".format(action))

        if errors:
            self.logger.error("Malformed object received\n{}".format("\n".join(errors)))
        else:
            handler = getattr(self, "object_{}".format(action))
            new_obj = handler(author, reader_persona, object_type, obj, session)

            if new_obj is not None:
                vesicle.handled = True
                new_obj.vesicles.append(vesicle)

                session.add(new_obj)
                session.add(vesicle)
                session.commit()
dataset/ETHPy150Open ciex/souma/synapse/__init__.py/Synapse.handle_object/swapped operands of `not in`