def object_delete(self, author, recipient, object_type, obj, session):
        # Verify message
        obj_class = globals()[object_type]
        for k in ["id", "modified"]:
            if k not in obj.keys():
                raise KeyError("Missing '{}' for deleting {} from changeset".format(k, obj_class.__name__))

        # Get the object's class from globals
        o = obj_class.query.get(obj["id"])

        if o is None:
            self.logger.info("Request to delete unknown <{} [{}]>".format(object_type, obj["id"]))
        else:
            if o.authorize("delete", author.id):
                if hasattr(o, "set_state"):
                    o.set_state(-2)
                    o.text = None
                    session.add(o)
                    self.logger.info("{} marked deleted".format(o))
                else:
                    name = str(o)
                    session.delete(o)
                    o = None
                    self.logger.info("Permanently deleted {}".format(name))
            else:
                self.logger.warning("Object deletion not authorized!")
        return o
dataset/ETHPy150Open ciex/souma/synapse/__init__.py/Synapse.object_delete/original