def msk_from_problem_urlname(course_id, urlname, block_type='problem'):
 if (not isinstance(course_id, CourseKey)):
  raise ValueError
 if urlname.endswith('.xml'):
  urlname = urlname[:(-4)]
 return course_id.make_usage_key(block_type, urlname)

def msk_from_problem_urlname ( course_id , urlname , block_type = 'problem' ) : if ( not isinstance ( course_id , CourseKey ) ) : raise ValueError if urlname . endswith ( '.xml' ) : urlname = urlname [ : ( - 4 ) ] return course_id . make_usage_key ( block_type , urlname )
convert a problem urlname to a module state key .