<commit_before>import logging

import chryso.connection
import flask

import dominus.tables
import dominus.views


def run():
    logging.basicConfig()
    logging.getLogger().setLevel(logging.DEBUG)

    app = flask.Flask('dominus')
    app.config.update(dict(
        FLASK_DEBUG = True,
        SECRET_KEY = 'development key',
    ))
    db = "postgres://dev:development@localhost:5432/dominus"
    engine = chryso.connection.Engine(db, dominus.tables)
    chryso.connection.store(engine)

    app.route('/')(dominus.views.root)

    try:
        app.run('localhost', '4554')
    except KeyboardInterrupt:
        print("Shutting down...")<commit_msg>Break out DB setup separately, enable debug<commit_after>import logging

import chryso.connection
import flask

import dominus.tables
import dominus.views

def setup_db():
    db = "postgres://dev:development@localhost:5432/dominus"
    engine = chryso.connection.Engine(db, dominus.tables)
    chryso.connection.store(engine)

def run():
    logging.basicConfig()
    logging.getLogger().setLevel(logging.DEBUG)

    setup_db()

    app = flask.Flask('dominus')
    app.config.update(dict(
        FLASK_DEBUG = True,
        SECRET_KEY = 'development key',
    ))

    app.route('/')(dominus.views.root)
    app.route('/admin/')(dominus.views.admin)

    try:
        app.run(host='localhost', port=4554, debug=True)
    except KeyboardInterrupt:
        print("Shutting down...")
{'fraction_non_alphanumeric': 0.13161559888579388, 'fraction_numerical': 0.011142061281337047, 'mean_word_length': 3.4079754601226995, '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': '5954999', 'n_tokens_mistral': 481, 'n_tokens_neox': 452, 'n_words': 82}