'Returns the mode for the course corresponding to mode_slug.
Returns only non-expired modes.
If this particular mode is not set for the course, returns None
Arguments:
course_id (CourseKey): Search for course modes for this course.
mode_slug (str): Search for modes with this slug.
Keyword Arguments:
modes (list of `Mode`): If provided, search through this list
of course modes.  This can be used to avoid an additional
database query if you have already loaded the modes list.
include_expired (bool): If True, expired course modes will be included
in the returned values. If False, these modes will be omitted.
Returns:
Mode'

@classmethod
def mode_for_course(cls, course_id, mode_slug, modes=None, include_expired=False):

    if (modes is None):
        modes = cls.modes_for_course(course_id, include_expired=include_expired)
    matched = [m for m in modes if (m.slug == mode_slug)]
    if matched:
        return matched[0]
    else:
        return None
