<commit_before>import argparse
from ProcessingManager import ProcessingManager
from flask import Flask, request, jsonify
from flask.ext.socketio import SocketIO

parser = argparse.ArgumentParser(description='Starts the server to process tracks')
parser.add_argument('-p', '--port', dest='port', metavar='p', type=int,
        default=5000,
        help='port to use')
parser.add_argument('--debug', dest='debug', action='store_false',
        help='print server debug information')
parser.add_argument('--verbose', dest='verbose',
        action='store_false',
        help='print debug information of processing stage')
parser.add_argument('--config', '-c', dest='config', metavar='c', type=str,
        help='configuration file')
args = parser.parse_args()



app = Flask(__name__)
socketio = SocketIO(app)

manager = ProcessingManager(args.config)

def setHeaders(response):
    response.headers['Access-Control-Allow-Origin'] = '*'
    return response

def sendState():
    response = jsonify(manager.currentState())
    return setHeaders(response)

def undoStep():
    manager.restore()

@app.route('/previous', methods=['GET'])
def previous():
    """Restores a previous state

    Returns:
        A response instance
    """
    manager.restore()
    return sendState()

@app.route('/next', methods=['POST'])
def next():
    """Advances the progress

    Returns:
        A response instance<commit_msg>Remove web socket server<commit_after>import argparse
from ProcessingManager import ProcessingManager
from flask import Flask, request, jsonify
# from flask.ext.socketio import SocketIO

parser = argparse.ArgumentParser(description='Starts the server to process tracks')
parser.add_argument('-p', '--port', dest='port', metavar='p', type=int,
        default=5000,
        help='port to use')
parser.add_argument('--debug', dest='debug', action='store_false',
        help='print server debug information')
parser.add_argument('--verbose', dest='verbose',
        action='store_false',
        help='print debug information of processing stage')
parser.add_argument('--config', '-c', dest='config', metavar='c', type=str,
        help='configuration file')
args = parser.parse_args()



app = Flask(__name__)
# socketio = SocketIO(app)

manager = ProcessingManager(args.config)

def setHeaders(response):
    response.headers['Access-Control-Allow-Origin'] = '*'
    return response

def sendState():
    response = jsonify(manager.currentState())
    return setHeaders(response)

def undoStep():
    manager.restore()

@app.route('/previous', methods=['GET'])
def previous():
    """Restores a previous state

    Returns:
        A response instance
    """
    manager.restore()
    return sendState()

@app.route('/next', methods=['POST'])
def next():
    """Advances the progress

    Returns:
        A response instance
{'fraction_non_alphanumeric': 0.14028903771589707, 'fraction_numerical': 0.0028198801550934085, 'mean_word_length': 4.294776119402985, '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': '2386444', 'n_tokens_mistral': 812, 'n_tokens_neox': 783, 'n_words': 208}