'Get the state dicts corresponding to a list of events
Args:
event_ids(list(str)): events whose state should be returned
types(list[(str, str)]|None): List of (type, state_key) tuples
which are used to filter the state fetched. May be None, which
matches any key
Returns:
A deferred dict from event_id -> (type, state_key) -> state_event'

@defer.inlineCallbacks
def get_state_ids_for_events(self, event_ids, types=None):

    event_to_groups = (yield self._get_state_group_for_events(event_ids))
    groups = set(event_to_groups.itervalues())
    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.iteritems()}
    defer.returnValue({event: event_to_state[event] for event in event_ids})
