def _check_definition_room_lists(self, definition):
        # check rooms are valid room IDs
        room_id_keys = ["rooms", "not_rooms"]
        for key in room_id_keys:
            if key in definition:
                if type(definition[key]) != list:
                    raise SynapseError(400, "Expected %s to be a list." % key)
                for room_id in definition[key]:
                    RoomID.from_string(room_id)
Check that "rooms" and "not_rooms" are lists of room ids if they
dataset/ETHPy150Open matrix-org/synapse/synapse/api/filtering.py/Filtering._check_definition_room_lists