def course_key_is_valid(course_key):
if course_key is None:<EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>CourseKey.from_string(text_type(course_key))<EOL><DEDENT>except (InvalidKeyError, UnicodeDecodeError):<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Course key object validation