<commit_before>from flask import Flask, render_template, json
from flask_bootstrap import Bootstrap
import parser
import graphs

def init():
    """Initializing function of the Flask app for the Snort dashboard.
    """
    app = Flask(__name__)
    Bootstrap(app)
    app.config['TEMPLATES_AUTO_RELOAD'] = True

    @app.route('/')
    def index():
        """Starts the Flask app and calls parse.py's main parsing
        function and then calls graphs.py's main visualization
        function.  After these functions run, the dashboard home
        template is rendered and shown to the user.
        """
        parser.parse_everything()
        graphs.visualize()
        #f = open("_reload.py", "a")
        #f.write("1")
        #f.close()
        return render_template('index.html')

    @app.after_request
    def reload(response):
        with open ('_reload.py', "a") as f:
            f.write("1")
        return response
    return app
if __name__ == "__main__":
    init().run(debug=True, extra_files=['_reload.py'])<commit_msg>Deleted unused code and corrected formatting<commit_after>from flask import Flask, render_template, json
from flask_bootstrap import Bootstrap
import parser
import graphs

def init():
    """Initializing function of the Flask app for the Snort dashboard.
    """
    app = Flask(__name__)
    Bootstrap(app)
    app.config['TEMPLATES_AUTO_RELOAD'] = True

    @app.route('/')
    def index():
        """Starts the Flask app and calls parse.py's main parsing
        function and then calls graphs.py's main visualization
        function.  After these functions run, the dashboard home
        template is rendered and shown to the user.
        """
        parser.parse_everything()
        graphs.visualize()

        return render_template('index.html')

    @app.after_request
    def reload(response):
        with open ('_reload.py', "a") as f:
            f.write("1")
        return response
    return app

if __name__ == "__main__":
    init().run(debug=True, extra_files=['_reload.py'])
{'fraction_non_alphanumeric': 0.10485056344928956, 'fraction_numerical': 0.0014698677119059284, 'mean_word_length': 2.7884972170686457, 'pattern_counts': {'":': 2, '<': 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': '7262036', 'n_tokens_mistral': 594, 'n_tokens_neox': 566, 'n_words': 187}