<s> from flask import request , session <EOL> from flask import Blueprint <EOL> import api <EOL> import json <EOL> import mimetypes <EOL> import os . path <EOL> import api . auth <EOL> import api . cache <EOL> import api . stats <EOL> import asyncio <EOL> import threading <EOL> from api . annotations import * <EOL> from api . common import flat_multi <EOL> from api . exceptions import * <EOL> blueprint = Blueprint ( "<STR_LIT>" , __name__ ) <EOL> @ blueprint . route ( "<STR_LIT>" , methods = [ "<STR_LIT:GET>" ] ) <EOL> @ api_wrapper <EOL> @ require_login <EOL> @ require_teacher <EOL> def get_group_list_hook ( ) : <EOL> return { "<STR_LIT:success>" : <NUM_LIT:1> , "<STR_LIT:data>" : api . group . get_groups ( ) } <EOL> @ blueprint . route ( "<STR_LIT>" , methods = [ "<STR_LIT:POST>" ] ) <EOL> @ api_wrapper <EOL> @ require_login <EOL> @ require_teacher <EOL> def create_group_hook ( ) : <EOL> gid = api . group . create_group_request ( api . common . flat_multi ( request . form ) ) <EOL> return { "<STR_LIT:success>" : <NUM_LIT:1> , "<STR_LIT:message>" : "<STR_LIT>" } <EOL> @ blueprint . route ( "<STR_LIT>" , methods = [ "<STR_LIT:POST>" ] ) <EOL> @ api_wrapper <EOL> @ require_login <EOL> @ require_teacher <EOL> def delete_group_hook ( ) : <EOL> api . group . delete_group_request ( api . common . flat_multi ( request . form ) ) <EOL> return { "<STR_LIT:success>" : <NUM_LIT:1> , "<STR_LIT:message>" : "<STR_LIT>" } <EOL> @ blueprint . route ( "<STR_LIT>" , methods = [ "<STR_LIT:POST>" ] ) <EOL> @ api_wrapper <EOL> @ require_login <EOL> @ require_teacher <EOL> def add_team_group_hook ( ) : <EOL> api . group . add_member ( api . common . flat_multi ( request . form ) ) <EOL> return { "<STR_LIT:success>" : <NUM_LIT:1> , "<STR_LIT:message>" : "<STR_LIT>" } <EOL> @ blueprint . route ( "<STR_LIT>" , methods = [ "<STR_LIT:POST>" ] ) <EOL> @ api_wrapper <EOL> @ require_login <EOL> @ require_teacher <EOL> def remove_team_group_hook ( ) : <EOL> api . group . remove_member ( api . common . flat_multi ( request . form ) ) <EOL> return { "<STR_LIT:success>" : <NUM_LIT:1> , "<STR_LIT:message>" : "<STR_LIT>" } </s>
