def is_cohort_exists(course_key, name):
 return CourseUserGroup.objects.filter(course_id=course_key, group_type=CourseUserGroup.COHORT, name=name).exists()

def is_cohort_exists ( course_key , name ) : return CourseUserGroup . objects . filter ( course_id = course_key , group_type = CourseUserGroup . COHORT , name = name ) . exists ( )
check if a cohort already exists .