'Find all modes for a list of course IDs, including expired modes.
Courses that do not have a course mode will be given a default mode.
Arguments:
course_id_list (list): List of `CourseKey`s
Returns:
dict mapping `CourseKey` to lists of `Mode`'

@classmethod
def all_modes_for_courses(cls, course_id_list):

    modes_by_course = defaultdict(list)
    for mode in cls.objects.filter(course_id__in=course_id_list):
        modes_by_course[mode.course_id].append(mode.to_tuple())
    missing_courses = (set(course_id_list) - set(modes_by_course.keys()))
    for course_id in missing_courses:
        modes_by_course[course_id] = [cls.DEFAULT_MODE]
    return modes_by_course
