@cachedList(cache=_get_state_group_for_event.cache, list_name="event_ids",
                num_args=1, inlineCallbacks=True)
    def _get_state_group_for_events(self, event_ids):
        rows = yield self._simple_select_many_batch(
            table="event_to_state_groups",
            column="event_id",
            iterable=event_ids,
            keyvalues={},
            retcols=("event_id", "state_group",),
            desc="_get_state_group_for_events",
        )

        defer.returnValue({row["event_id"]: row["state_group"] for row in rows})
Returns mapping event_id -> state_group
dataset/ETHPy150Open matrix-org/synapse/synapse/storage/state.py/StateStore._get_state_group_for_events