def METHOD_NAME(data):
    room_ids = [room["id"] for room in data["rooms"]]
    track_ids = [track["id"] for track in data["tracks"]]
    speaker_ids = [speaker["code"] for speaker in data["speakers"]]
    for talk in data["talks"]:
        if not talk["start"]:
            raise ValidationError(
                f"Talk {talk['code']} ({talk['title']}) has no valid start datetime."
            )
        if not talk["end"]:
            raise ValidationError(
                f"Talk {talk['code']} ({talk['title']}) has no valid start datetime."
            )
        start = parse(talk["start"])
        end = parse(talk["end"])
        if start > end:
            raise ValidationError(
                f"Talk {talk['code']} ({talk['title']}) has a start that is later than its end."
            )
        if talk["track"] and not talk["track"] in track_ids:
            raise ValidationError(
                f"Talk {talk['code']} ({talk['title']}) has an invalid track ID."
            )
        if not talk["room"] in room_ids:
            raise ValidationError(
                f"Talk {talk['code']} ({talk['title']}) has an invalid room ID."
            )
        for speaker in talk.get("speakers", []):
            if speaker not in speaker_ids:
                raise ValidationError(
                    f"Talk {talk['code']} ({talk['title']}) has an unknown speaker ID: {speaker}."
                )