<s> from flask import Blueprint <EOL> import api <EOL> from api . common import WebSuccess , WebError <EOL> from api . annotations import api_wrapper , require_login , require_teacher , require_admin <EOL> from api . annotations import log_action <EOL> blueprint = Blueprint ( "<STR_LIT>" , __name__ ) <EOL> @ blueprint . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' ] ) <EOL> @ api_wrapper <EOL> @ require_admin <EOL> def get_all_problems_hook ( ) : <EOL> problems = api . problem . get_all_problems ( ) <EOL> if problems is None : <EOL> return WebError ( "<STR_LIT>" ) <EOL> return WebSuccess ( data = problems ) <EOL> @ blueprint . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' ] ) <EOL> @ api_wrapper <EOL> @ require_admin <EOL> def get_all_users_hook ( ) : <EOL> users = api . user . get_all_users ( ) <EOL> if users is None : <EOL> return WebError ( "<STR_LIT>" ) <EOL> return WebSuccess ( data = users ) </s>
