<commit_before>from flask import Blueprint, jsonify

api = Blueprint('api', __name__, '/api')

@api.route('/')
def welcome():
    return 'Welcome to the Hermes Scoring server'

#Bot API endpoint list
@api.route('/bot/session/open')
def FlaskBotSessionOpen():
    endpoints.BotSessionOpen()

@api.route('/bot/session/close')
def FlaskBotSessionClose():
    endpoints.BotSessionClose()

@api.route('/bot/session/update')
def FlaskBotSessionUpdate():
    endpoints.BotSessionUpdate()

@api.route('/bot/jobs/list')
def FlaskBotJobsList():
    endpoints.BotJobsList()

@api.route('/bot/jobs/check-in')
def FlaskBotJobsCheckin():
    endpoints.BotJobsCheckin()

@api.route('/bot/jobs/request')
def FlaskBotJobsRequest():
    endpoints.BotJobsRequest()

@api.route('/bot/jobs/abort')
def FlaskBotJobsAbort():
    endpoints.BotJobsAbort()

#TODO Finish prototyping server API endpoints
#TODO Add requirements for server API endpoints
"""
NOTE: The following API endpoints will expect JSON.
If it is referencing a host on a team, it will need
to send a JSON object specifying those parameters
"""
@api.route('/web-gui/session/open')
def FlaskWebServerSessionOpen():
    endpoints.WebServerSessionOpen()

@api.route('/web-gui/session/close')
def FlaskWebServerSessionClose():
    endpoints.WebServerSessionClose()

@api.route('/web-gui/team/list')
def FlaskWebServerTeamList():
    endpoints.WebServerTeamList()

@api.route('/web-gui/team/create')
def FlaskWebServerTeamCreate():
    endpoints.WebServerTeamCreate()

@api.route('/web-gui/team/delete')
def FlaskWebServerTeamDelete():
    endpoints.WebServerTeamDelete()

@api.route('/web-gui/host/list')
def FlaskWebServerHostList():
    endpoints.WebServerHostList()

@api.route('/web-gui/host/create')
def FlaskWebServerHostCreate():
    endpoints.WebServerTeamCreate()

@api.route('/web-gui/host/delete')
def FlaskWebServerHostDelete():
    endpoints.WebServerHostDelete()

@api.route('/web-gui/service/list')
def FlaskWebServersServiceList():
    endpoints.WebServersServiceList()

@api.route('/web-gui/service/create')
def FlaskWebServerServiceCreate():
    endpoints.WebServerServiceCreate()

@api.route('/web-gui/service/delete')
def FlaskWebServerServiceDelete():
    endpoints.WebServerServiceDelete()

@api.route('/web-gui/check/enable')
def FlaskWebServerCheckEnable():
    endpoints.FlaskWebServerCheckEnable()

@api.route('/web-gui/check/disable')
def FlaskWebServerCheckDisable():
    endpoints.WebServerCheckDisable()

@api.route('/web-gui/check/interval/list')
def FlaskWebServerCheckIntervalList():
    endpoints.WebServerCheckIntervalList()

@api.route('/web-gui/check/interval/set')
def FlaskWebServerCheckIntervalSet():
    endpoints.WebServerCheckIntervalSet()

@api.route('/web-gui/check/interval/default')
def FlaskWebServerCheckIntervalDefault():
    endpoints.WebServerCheckIntervalDefault()<commit_msg>view functions need to return something! also actually import endpoints. fixes url prefix<commit_after>from flask import Blueprint
from . import endpoints

api = Blueprint('api', __name__, url_prefix='/api')

@api.route('/')
def welcome():
    return 'Welcome to the Hermes Scoring server'

#Bot API endpoint list
@api.route('/bot/session/open')
def FlaskBotSessionOpen():
    return endpoints.BotSessionOpen()

@api.route('/bot/session/close')
def FlaskBotSessionClose():
    return endpoints.BotSessionClose()

@api.route('/bot/session/update')
def FlaskBotSessionUpdate():
    return endpoints.BotSessionUpdate()

@api.route('/bot/jobs/list')
def FlaskBotJobsList():
    return endpoints.BotJobsList()

@api.route('/bot/jobs/check-in')
def FlaskBotJobsCheckin():
    return endpoints.BotJobsCheckin()

@api.route('/bot/jobs/request')
def FlaskBotJobsRequest():
    return endpoints.BotJobsRequest()

@api.route('/bot/jobs/abort')
def FlaskBotJobsAbort():
    return endpoints.BotJobsAbort()

#TODO Finish prototyping server API endpoints
#TODO Add requirements for server API endpoints
"""
NOTE: The following API endpoints will expect JSON.
If it is referencing a host on a team, it will need
to send a JSON object specifying those parameters
"""
@api.route('/web-gui/session/open')
def FlaskWebServerSessionOpen():
    return endpoints.WebServerSessionOpen()

@api.route('/web-gui/session/close')
def FlaskWebServerSessionClose():
    return endpoints.WebServerSessionClose()

@api.route('/web-gui/team/list')
def FlaskWebServerTeamList():
    return endpoints.WebServerTeamList()

@api.route('/web-gui/team/create')
def FlaskWebServerTeamCreate():
    return endpoints.WebServerTeamCreate()

@api.route('/web-gui/team/delete')
def FlaskWebServerTeamDelete():
    return endpoints.WebServerTeamDelete()

@api.route('/web-gui/host/list')
def FlaskWebServerHostList():
    return endpoints.WebServerHostList()

@api.route('/web-gui/host/create')
def FlaskWebServerHostCreate():
    return endpoints.WebServerTeamCreate()

@api.route('/web-gui/host/delete')
def FlaskWebServerHostDelete():
    return endpoints.WebServerHostDelete()

@api.route('/web-gui/service/list')
def FlaskWebServersServiceList():
    return endpoints.WebServersServiceList()

@api.route('/web-gui/service/create')
def FlaskWebServerServiceCreate():
    return endpoints.WebServerServiceCreate()

@api.route('/web-gui/service/delete')
def FlaskWebServerServiceDelete():
    return endpoints.WebServerServiceDelete()

@api.route('/web-gui/check/enable')
def FlaskWebServerCheckEnable():
    return endpoints.FlaskWebServerCheckEnable()

@api.route('/web-gui/check/disable')
def FlaskWebServerCheckDisable():
    return endpoints.WebServerCheckDisable()

@api.route('/web-gui/check/interval/list')
def FlaskWebServerCheckIntervalList():
    return endpoints.WebServerCheckIntervalList()

@api.route('/web-gui/check/interval/set')
def FlaskWebServerCheckIntervalSet():
    return endpoints.WebServerCheckIntervalSet()

@api.route('/web-gui/check/interval/default')
def FlaskWebServerCheckIntervalDefault():
    return endpoints.WebServerCheckIntervalDefault()
{'fraction_non_alphanumeric': 0.13485580930155025, 'fraction_numerical': 0.0, 'mean_word_length': 5.841505131128848, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1959441', 'n_tokens_mistral': 1885, 'n_tokens_neox': 1832, 'n_words': 348}