'Get a PDU from the database with given origin and id.
Returns:
Deferred: Results in a `Pdu`.'

@defer.inlineCallbacks
@log_function
def get_persisted_pdu(self, origin, event_id, do_auth=True):

    event = (yield self.store.get_event(event_id, allow_none=True, allow_rejected=True))
    if event:
        if self.is_mine_id(event.event_id):
            event.signatures.update(compute_event_signature(event, self.hs.hostname, self.hs.config.signing_key[0]))
        if do_auth:
            in_room = (yield self.auth.check_host_in_room(event.room_id, origin))
            if (not in_room):
                raise AuthError(403, 'Host    not    in    room.')
            events = (yield self._filter_events_for_server(origin, event.room_id, [event]))
            event = events[0]
        defer.returnValue(event)
    else:
        defer.returnValue(None)
