<commit_before>from heutagogy import app
import heutagogy.persistence
import os
from datetime import timedelta

app.config.from_object(__name__)
app.config.update(dict(
    USERS={
        'myuser': {'password': '<PASSWORD>'},
        'user2': {'password': '<PASSWORD>'},
    },
    JWT_AUTH_URL_RULE='/api/v1/login',
    JWT_EXPIRATION_DELTA=timedelta(seconds=2592000),  # 1 month
    DATABASE=os.path.join(app.root_path, 'heutagogy.sqlite3'),
    DEBUG=True))
app.config.from_envvar('HEUTAGOGY_SETTINGS', silent=True)

if not app.config['SECRET_KEY']:
    app.config['SECRET_KEY'] = 'super-secret'


@app.cli.command('initdb')
def initdb_command():
    """Creates the database tables."""
    heutagogy.persistence.initialize()<commit_msg>Initialize database if it does not exist<commit_after>from heutagogy import app
import heutagogy.persistence
import os
from datetime import timedelta

app.config.from_object(__name__)
app.config.update(dict(
    USERS={
        'myuser': {'password': '<PASSWORD>'},
        'user2': {'password': '<PASSWORD>'},
    },
    JWT_AUTH_URL_RULE='/api/v1/login',
    JWT_EXPIRATION_DELTA=timedelta(seconds=2592000),  # 1 month
    DATABASE=os.path.join(app.root_path, 'heutagogy.sqlite3'),
    DEBUG=True))
app.config.from_envvar('HEUTAGOGY_SETTINGS', silent=True)

if not app.config['SECRET_KEY']:
    app.config['SECRET_KEY'] = 'super-secret'


@app.cli.command('initdb')
def initdb_command():
    """Creates the database tables."""
    heutagogy.persistence.initialize()


with app.app_context():
    if not os.path.isfile(app.config['DATABASE']):
        heutagogy.persistence.initialize()
{'fraction_non_alphanumeric': 0.14996926859250154, 'fraction_numerical': 0.013521819299323909, 'mean_word_length': 4.7935943060498225, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1964980', 'n_tokens_mistral': 596, 'n_tokens_neox': 582, 'n_words': 97}