human
Solve the following python programming problem given the following code:
@ defer.inlineCallbacks 
def _filter_events_for_server(self, server_name, room_id, events) : 
    event_to_state = (yield self.store.get_state_for_events (frozenset ((e.event_id for e in redact_disallowed)), types = ((EventTypes.RoomHistoryVisibility, ''), (EventTypes.Member, None)))) 
    def redact_disallowed(event, state) : 
        if (not state) : 
            return event 
history = state.get ((EventTypes.RoomHistoryVisibility, ''), None) 
        if history : 
            visibility = history.content.get ('history_visibility', 'shared') 
            if (visibility in ['invited', 'joined']) : 
                for ev in state.values () : 
                    if (ev.type != EventTypes.Member) : 
                        continue 
try : 
                        domain = UserID.from_string (ev.state_key).domain 
except : 
                        continue 
if (domain != server_name) : 
                        continue 
memtype = ev.membership 
                    if (memtype == Membership.JOIN) : 
                        return event 
else : 
                        if (memtype == Membership.INVITE) : 
                            if (visibility == 'invited') : 
                                return event 
else : 
                    return prune_event (event) 
return event 
defer.returnValue ([redact_disallowed (e, event_to_state [e.event_id]) for e in events]) 

    
    

    Fix the buggy line: event_to_state = (yield self.store.get_state_for_events (frozenset ((e.event_id for e in redact_disallowed)), types = ((EventTypes.RoomHistoryVisibility, ''), (EventTypes.Member, None))))
assistant
#Here is Python code to fix the buggy line: event_to_state = (yield self.

event_to_state = (yield self.store.get_state_for_events (frozenset ((e.event_id for e in events)), types = ((EventTypes.RoomHistoryVisibility, ''), (EventTypes.Member, None))))