def get_course_cohorts(course, assignment_type=None):
 migrate_cohort_settings(course)
 query_set = CourseUserGroup.objects.filter(course_id=course.location.course_key, group_type=CourseUserGroup.COHORT)
 query_set = (query_set.filter(cohort__assignment_type=assignment_type) if assignment_type else query_set)
 return list(query_set)

def get_course_cohorts ( course , assignment_type = None ) : migrate_cohort_settings ( course ) query_set = CourseUserGroup . objects . filter ( course_id = course . location . course_key , group_type = CourseUserGroup . COHORT ) query_set = ( query_set . filter ( cohort__assignment_type = assignment_type ) if assignment_type else query_set ) return list ( query_set )
get a list of all the cohorts in the given course .