def _get_cohort_representation(cohort, course):
 (group_id, partition_id) = cohorts.get_group_info_for_cohort(cohort)
 assignment_type = cohorts.get_assignment_type(cohort)
 return {'name': cohort.name, 'id': cohort.id, 'user_count': cohort.users.count(), 'assignment_type': assignment_type, 'user_partition_id': partition_id, 'group_id': group_id}

def _get_cohort_representation ( cohort , course ) : ( group_id , partition_id ) = cohorts . get_group_info_for_cohort ( cohort ) assignment_type = cohorts . get_assignment_type ( cohort ) return { 'name' : cohort . name , 'id' : cohort . id , 'user_count' : cohort . users . count ( ) , 'assignment_type' : assignment_type , 'user_partition_id' : partition_id , 'group_id' : group_id }
returns a json representation of a cohort .