<commit_before>import os
import sys
import traceback

from flask import Flask, g
from werkzeug.contrib.fixers import ProxyFix

from database import create_session
from decorators import template_renderer
from log_configuration import LogConfiguration
from mailer import Mailer
from mod_auth.controllers import mod_auth
from mod_ci.controllers import mod_ci
from mod_deploy.controllers import mod_deploy
from mod_home.controllers import mod_home
from mod_test.controllers import mod_test

app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
# Load config
app.config.from_object('config')
try:
    app.config['DEBUG'] = os.environ['DEBUG']
except KeyError:
    app.config['DEBUG'] = False

# Init logger
log_configuration = LogConfiguration('platform', app.config['DEBUG'])
log = log_configuration.create_logger("Platform")


def install_secret_keys(application, secret_session='secret_key',
                        secret_csrf='secret_csrf'):
    """Configure the SECRET_KEY from a file
    in the instance directory.

    If the file does not exist, print instructions
    to create it from a shell with a random key,
    then exit.
<commit_msg>Parse config separately<commit_after>import os
import sys
import traceback

from flask import Flask, g
from werkzeug.contrib.fixers import ProxyFix

from config_parser import parse_config
from database import create_session
from decorators import template_renderer
from log_configuration import LogConfiguration
from mailer import Mailer
from mod_auth.controllers import mod_auth
from mod_ci.controllers import mod_ci
from mod_deploy.controllers import mod_deploy
from mod_home.controllers import mod_home
from mod_test.controllers import mod_test

app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
# Load config
config = parse_config('config')
app.config.from_object(config)
try:
    app.config['DEBUG'] = os.environ['DEBUG']
except KeyError:
    app.config['DEBUG'] = False

# Init logger
log_configuration = LogConfiguration('platform', app.config['DEBUG'])
log = log_configuration.create_logger("Platform")


def install_secret_keys(application, secret_session='secret_key',
                        secret_csrf='secret_csrf'):
    """Configure the SECRET_KEY from a file
    in the instance directory.

    If the file does not exist, print instructions
    to create it from a shell with a random key,
    then exit.

{'fraction_non_alphanumeric': 0.06918238993710692, 'fraction_numerical': 0.0, 'mean_word_length': 5.086734693877551, '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': '4339126', 'n_tokens_mistral': 683, 'n_tokens_neox': 672, 'n_words': 220}