def _get_user_statuses(user, course_key, checkpoint):
 enrollment_cache_key = CourseEnrollment.cache_key_name(user.id, unicode(course_key))
 has_skipped_cache_key = SkippedReverification.cache_key_name(user.id, unicode(course_key))
 verification_status_cache_key = VerificationStatus.cache_key_name(user.id, unicode(course_key))
 cache_values = cache.get_many([enrollment_cache_key, has_skipped_cache_key, verification_status_cache_key])
 is_verified = cache_values.get(enrollment_cache_key)
 if (is_verified is None):
  is_verified = CourseEnrollment.is_enrolled_as_verified(user, course_key)
  cache.set(enrollment_cache_key, is_verified)
 has_skipped = cache_values.get(has_skipped_cache_key)
 if (has_skipped is None):
  has_skipped = SkippedReverification.check_user_skipped_reverification_exists(user, course_key)
  cache.set(has_skipped_cache_key, has_skipped)
 verification_statuses = cache_values.get(verification_status_cache_key)
 if (verification_statuses is None):
  verification_statuses = VerificationStatus.get_all_checkpoints(user.id, course_key)
  cache.set(verification_status_cache_key, verification_statuses)
 checkpoint = verification_statuses.get(checkpoint)
 has_completed_check = bool(checkpoint)
 return (is_verified, has_skipped, has_completed_check)

def _get_user_statuses ( user , course_key , checkpoint ) : enrollment_cache_key = CourseEnrollment . cache_key_name ( user . id , unicode ( course_key ) ) has_skipped_cache_key = SkippedReverification . cache_key_name ( user . id , unicode ( course_key ) ) verification_status_cache_key = VerificationStatus . cache_key_name ( user . id , unicode ( course_key ) ) cache_values = cache . get_many ( [ enrollment_cache_key , has_skipped_cache_key , verification_status_cache_key ] ) is_verified = cache_values . get ( enrollment_cache_key ) if ( is_verified is None ) : is_verified = CourseEnrollment . is_enrolled_as_verified ( user , course_key ) cache . set ( enrollment_cache_key , is_verified ) has_skipped = cache_values . get ( has_skipped_cache_key ) if ( has_skipped is None ) : has_skipped = SkippedReverification . check_user_skipped_reverification_exists ( user , course_key ) cache . set ( has_skipped_cache_key , has_skipped ) verification_statuses = cache_values . get ( verification_status_cache_key ) if ( verification_statuses is None ) : verification_statuses = VerificationStatus . get_all_checkpoints ( user . id , course_key ) cache . set ( verification_status_cache_key , verification_statuses ) checkpoint = verification_statuses . get ( checkpoint ) has_completed_check = bool ( checkpoint ) return ( is_verified , has_skipped , has_completed_check )
retrieve all the information we need to determine the users group .