def _get_course_key(course_key_or_id):
 return (CourseKey.from_string(course_key_or_id) if isinstance(course_key_or_id, basestring) else course_key_or_id)

def _get_course_key ( course_key_or_id ) : return ( CourseKey . from_string ( course_key_or_id ) if isinstance ( course_key_or_id , basestring ) else course_key_or_id )
helper method to get a course key eith from a string or a coursekey .