def handle_object_request(self, vesicle, reader_persona, session):
        """
        Act on received object requests by sending the object in question back

        Args:
            vesicle (Vesicle): Vesicle containing metadata about the object
        """

        # Validate vesicle
        errors = []
        object_id = None
        object_type = None

        try:
            object_id = vesicle.data["object_id"]
            object_type = vesicle.data["object_type"]
            recipient = vesicle.author
        except KeyError, e:
            errors.append("missing ({})".format(vesicle, e))

        if OBJECT_TYPES not in object_type:
            errors.append("invalid object_type: {}".format(object_type))

        if errors:
            self._log_errors("Received invalid object request", errors)
        else:
            # Load object
            obj_class = globals()[object_type]
            obj = obj_class.query.get(object_id)

            if obj is None:
                self.logger.error("Requested object <{type} {id}> not found".format(
                    type=object_type, id=object_id[:6]))

            elif hasattr(obj, "author") and recipient not in obj.author.contacts:
                    self.logger.info("Requested {} not published for request author {}".format(obj, recipient))
            elif isinstance(obj, Persona) and recipient not in obj.contacts:
                    self.logger.info("Requested {} does not have requesting {} as a contact.".format(obj, recipient))
            else:
                for v in obj.vesicles:
                    # Send response
                    # Modified vesicles (re-encrypted) don't get saved to DB
                    self._distribute_vesicle(v, recipients=[recipient, ])
                self.logger.info("Sent {}'s {} vesicles to {}".format(
                    obj, len(obj.vesicles), recipient
                ))

        vesicle.handled = True
        session.add(vesicle)
        session.commit()
dataset/ETHPy150Open ciex/souma/synapse/__init__.py/Synapse.handle_object_request/swapped operands of `not in`