@defer.inlineCallbacks
    def get_state_for_events(self, event_ids, types):
        event_to_groups = yield self._get_state_group_for_events(
            event_ids,
        )

        groups = set(event_to_groups.values())
        group_to_state = yield self._get_state_for_groups(groups, types)

        event_to_state = {
            event_id: group_to_state[group]
            for event_id, group in event_to_groups.items()
        }

        defer.returnValue({event: event_to_state[event] for event in event_ids})
Given a list of event_ids and type tuples, return a list of state
dataset/ETHPy150Open matrix-org/synapse/synapse/storage/state.py/StateStore.get_state_for_events