#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def _get_events( self , event_ids , check_redacted = True , get_prev_content = False , allow_rejected = False ) : #NEWLINE# #INDENT# if ( not event_ids ) : #NEWLINE# #INDENT# defer . returnValue ( [ ] ) #NEWLINE# #UNINDENT# event_id_list = event_ids #NEWLINE# event_ids = set ( event_ids ) #NEWLINE# event_map = self . _get_events_from_cache ( event_ids , check_redacted = check_redacted , get_prev_content = get_prev_content , allow_rejected = allow_rejected ) #NEWLINE# missing_events_ids = [ e for e in event_ids if ( e not in event_map ) ] #NEWLINE# if missing_events_ids : #NEWLINE# #INDENT# missing_events = ( yield self . _enqueue_events ( missing_events_ids , check_redacted = check_redacted , get_prev_content = get_prev_content , allow_rejected = allow_rejected ) ) #NEWLINE# event_map . update ( missing_events ) #NEWLINE# #UNINDENT# defer . returnValue ( [ event_map [ e_id ] for e_id in event_id_list if ( ( e_id in event_map ) and event_map [ e_id ] ) ] )