'Returns a list of names of cohort groups in which the given user
belongs.'

def _user_cohort_group_names(self, user, context):

    cohort_group_names = []
    if context.cohorts_enabled:
        group = get_cohort(user, context.course_id, assign=False, use_cached=True)
        cohort_group_names.append((group.name if group else ''))
    return cohort_group_names
