def get_problem(problem_path):
"""
Retrieve a problem spec from a given problem directory.
Args:
problem_path: path to the root of the problem directory.
Returns:
A problem object.
"""
json_path = join(problem_path, "problem.json")
problem = json.loads(open(json_path, "r").read())
try:
problem_schema(problem)
except MultipleInvalid as e:
logger.critical("Error validating problem object at '%s'!", json_path)
logger.critical(e)
raise FatalException
return problem
评论列表
文章目录