def _default_course_mode(course_id):
 course_modes = CourseMode.modes_for_course(CourseKey.from_string(course_id))
 available_modes = [m.slug for m in course_modes]
 if (CourseMode.DEFAULT_MODE_SLUG in available_modes):
  return CourseMode.DEFAULT_MODE_SLUG
 elif ('audit' in available_modes):
  return 'audit'
 elif ('honor' in available_modes):
  return 'honor'
 return CourseMode.DEFAULT_MODE_SLUG

def _default_course_mode ( course_id ) : course_modes = CourseMode . modes_for_course ( CourseKey . from_string ( course_id ) ) available_modes = [ m . slug for m in course_modes ] if ( CourseMode . DEFAULT_MODE_SLUG in available_modes ) : return CourseMode . DEFAULT_MODE_SLUG elif ( 'audit' in available_modes ) : return 'audit' elif ( 'honor' in available_modes ) : return 'honor' return CourseMode . DEFAULT_MODE_SLUG
return the default enrollment for a course .