'Get the state groups for the given list of event_ids
The return value is a dict mapping group names to lists of events.'

@defer.inlineCallbacks
def get_state_groups(self, room_id, event_ids):

    if (not event_ids):
        defer.returnValue({})
    group_to_ids = (yield self.get_state_groups_ids(room_id, event_ids))
    state_event_map = (yield self.get_events([ev_id for group_ids in group_to_ids.itervalues() for ev_id in group_ids.itervalues()], get_prev_content=False))
    defer.returnValue({group: [state_event_map[v] for v in event_id_map.itervalues() if (v in state_event_map)] for (group, event_id_map) in group_to_ids.iteritems()})
