def get_group_info_for_cohort(cohort, use_cached=False):
 request_cache = RequestCache.get_request_cache()
 cache_key = u'cohorts.get_group_info_for_cohort.{}'.format(cohort.id)
 if (use_cached and (cache_key in request_cache.data)):
  return request_cache.data[cache_key]
 request_cache.data.pop(cache_key, None)
 try:
  partition_group = CourseUserGroupPartitionGroup.objects.get(course_user_group=cohort)
  return request_cache.data.setdefault(cache_key, (partition_group.group_id, partition_group.partition_id))
 except CourseUserGroupPartitionGroup.DoesNotExist:
  pass
 return request_cache.data.setdefault(cache_key, (None, None))

def get_group_info_for_cohort ( cohort , use_cached = False ) : request_cache = RequestCache . get_request_cache ( ) cache_key = u'cohorts.get_group_info_for_cohort.{}' . format ( cohort . id ) if ( use_cached and ( cache_key in request_cache . data ) ) : return request_cache . data [ cache_key ] request_cache . data . pop ( cache_key , None ) try : partition_group = CourseUserGroupPartitionGroup . objects . get ( course_user_group = cohort ) return request_cache . data . setdefault ( cache_key , ( partition_group . group_id , partition_group . partition_id ) ) except CourseUserGroupPartitionGroup . DoesNotExist : pass return request_cache . data . setdefault ( cache_key , ( None , None ) )
get the ids of the group and partition to which this cohort has been linked as a tuple of .