def METHOD_NAME(course_key):
    """
    Return the ccx that is active for this course.
    course_key is expected to be an instance of an opaque CourseKey, a
    ValueError is raised if this expectation is not met.
    """
    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 = 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]