def class_keys_to_video_id_keys(videos):
    """
  Transform a dictionary with keys = classes, values = video lists to a dictionary where key = video id, value = class.
  :param videos:    Dictionary with classes as keys.
  :return:          Dictionary with video ids as keys.
  """

    new_videos = {}

    for cls, vids in videos.items():
        for vid in vids:
            new_videos[vid] = cls

    return new_videos