<commit_before>import os, sys

from flask import Flask, render_template
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

class CustomFlask(Flask):
    # we deal with jinja2 options to remove whitespace
    jinja_options = dict(
        Flask.jinja_options, trim_blocks=True, lstrip_blocks=True)

app = CustomFlask(__name__)

app.config.from_pyfile(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                    '../../../etc/webconfig.py'))

sys.path.insert(0, app.config['ROOT_FOLDER'])

# SQLAlchemy
engine = create_engine(app.config['DATABASE_URI'],
                       echo=app.config['DEBUG'])
Session = sessionmaker(bind=engine, autoflush=True)
session = Session()


from app.firewose.views import mod as uiModule
app.register_blueprint(uiModule)

# 404 / 500 errors

@app.errorhandler(404)
def page_not_found(e):
    return render_template('404.html'), 404

@app.errorhandler(500)
def server_error(e):
    return render_template('500.html'), 500<commit_msg>update: __init__: rename ui -> firewose<commit_after>import os, sys

from flask import Flask, render_template
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

class CustomFlask(Flask):
    # we deal with jinja2 options to remove whitespace
    jinja_options = dict(
        Flask.jinja_options, trim_blocks=True, lstrip_blocks=True)

app = CustomFlask(__name__)

app.config.from_pyfile(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                    '../../../etc/webconfig.py'))

sys.path.insert(0, app.config['ROOT_FOLDER'])

# SQLAlchemy
engine = create_engine(app.config['DATABASE_URI'],
                       echo=app.config['DEBUG'])
Session = sessionmaker(bind=engine, autoflush=True)
session = Session()


from app.firewose.views import mod as firewose_module
app.register_blueprint(firewose_module)

# 404 / 500 errors

@app.errorhandler(404)
def page_not_found(e):
    return render_template('404.html'), 404

@app.errorhandler(500)
def server_error(e):
    return render_template('500.html'), 500
{'fraction_non_alphanumeric': 0.11567877629063097, 'fraction_numerical': 0.0248565965583174, 'mean_word_length': 4.043373493975904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2069114', 'n_tokens_mistral': 727, 'n_tokens_neox': 665, 'n_words': 139}