def get_current_ccx(course_key):
 if (not isinstance(course_key, CourseKey)):
  raise ValueError('get_current_ccx requires a CourseKey instance')
 if (not isinstance(course_key, CCXLocator)):
  return None
 ccx_cache = request_cache.get_cache('ccx')
 if (course_key not in ccx_cache):
  ccx_cache[course_key] = CustomCourseForEdX.objects.get(pk=course_key.ccx)
 return ccx_cache[course_key]

def get_current_ccx ( course_key ) : if ( not isinstance ( course_key , CourseKey ) ) : raise ValueError ( 'get_current_ccx requires a CourseKey instance' ) if ( not isinstance ( course_key , CCXLocator ) ) : return None ccx_cache = request_cache . get_cache ( 'ccx' ) if ( course_key not in ccx_cache ) : ccx_cache [ course_key ] = CustomCourseForEdX . objects . get ( pk = course_key . ccx ) return ccx_cache [ course_key ]
return the ccx that is active for this course .