def get_course_enrollment_details(course_id, include_expired=False):
 cache_key = u'enrollment.course.details.{course_id}.{include_expired}'.format(course_id=course_id, include_expired=include_expired)
 cached_enrollment_data = None
 try:
  cached_enrollment_data = cache.get(cache_key)
 except Exception:
  log.exception(u'Error occurred while retrieving course enrollment details from the cache')
 if cached_enrollment_data:
  log.info(u'Get enrollment data for course %s (cached)', course_id)
  return cached_enrollment_data
 course_enrollment_details = _data_api().get_course_enrollment_info(course_id, include_expired)
 try:
  cache_time_out = getattr(settings, 'ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT', 60)
  cache.set(cache_key, course_enrollment_details, cache_time_out)
 except Exception:
  log.exception(u'Error occurred while caching course enrollment details for course %s', course_id)
  raise errors.CourseEnrollmentError(u'An unexpected error occurred while retrieving course enrollment details.')
 log.info(u'Get enrollment data for course %s', course_id)
 return course_enrollment_details

def get_course_enrollment_details ( course_id , include_expired = False ) : cache_key = u'enrollment.course.details.{course_id}.{include_expired}' . format ( course_id = course_id , include_expired = include_expired ) cached_enrollment_data = None try : cached_enrollment_data = cache . get ( cache_key ) except Exception : log . exception ( u'Error occurred while retrieving course enrollment details from the cache' ) if cached_enrollment_data : log . info ( u'Get enrollment data for course %s (cached)' , course_id ) return cached_enrollment_data course_enrollment_details = _data_api ( ) . get_course_enrollment_info ( course_id , include_expired ) try : cache_time_out = getattr ( settings , 'ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT' , 60 ) cache . set ( cache_key , course_enrollment_details , cache_time_out ) except Exception : log . exception ( u'Error occurred while caching course enrollment details for course %s' , course_id ) raise errors . CourseEnrollmentError ( u'An unexpected error occurred while retrieving course enrollment details.' ) log . info ( u'Get enrollment data for course %s' , course_id ) return course_enrollment_details
get the course modes for course .