'Parses course key from string'

def _parse_course_key(self, raw_value):

    try:
        result = CourseKey.from_string(raw_value)
    except InvalidKeyError:
        raise CommandError(("Invalid    course_key:    '%s'." % raw_value))
    if (not isinstance(result, CourseLocator)):
        raise CommandError(u'Argument    {0}    is    not    a    course    key'.format(raw_value))
    return result
