'Retrieve the course, then cache it to avoid Mongo queries.'

def _load_course_with_cache(self, course_key, course_cache):

    course = (course_cache[course_key] if (course_key in course_cache) else modulestore().get_course(course_key, depth=0))
    course_cache[course_key] = course
    return course
