<commit_before>"""
Module to contain application configuration.
Any site-specific configuration, such as database connection paramters, should
be read from environment variables here.
"""
import os
import json

# Amazon S3 config
S3_LOCATION=os.environ['S3_LOCATION']
S3_KEY=os.environ['S3_KEY']
S3_SECRET=os.environ['S3_SECRET']
S3_UPLOAD_DIRECTORY=os.environ['S3_UPLOAD_DIRECTORY']
S3_BUCKET=os.environ['S3_BUCKET']

# Flask Secret Key for creating sessions
SECRET_KEY=os.environ['FLASK_SECRET_KEY']

DEBUG = True
<commit_msg>Read DB config from env vars<commit_after>"""
Module to contain application configuration.
Any site-specific configuration, such as database connection paramters, should
be read from environment variables here.
"""
import os
import json

# Amazon S3 config
S3_LOCATION=os.environ['S3_LOCATION']
S3_KEY=os.environ['S3_KEY']
S3_SECRET=os.environ['S3_SECRET']
S3_UPLOAD_DIRECTORY=os.environ['S3_UPLOAD_DIRECTORY']
S3_BUCKET=os.environ['S3_BUCKET']

# Flask Secret Key for creating sessions
SECRET_KEY=os.environ['FLASK_SECRET_KEY']

# Postgres configuration
DB_CONFIG_DICT = {
        'user': os.environ['DB_USER'],
        'password': os.environ['DB_PASSWORD'],
        'host': os.environ['DB_HOST'],
        'port': os.environ['DB_PORT'],
        'database': os.environ['DB_NAME'],
}
DB_CONN_URI = (
    "postgresql://{user}:{password}@{host}:{port}/{database}"
    .format(**DB_CONFIG_DICT))

DEBUG = True

{'fraction_non_alphanumeric': 0.12691771269177127, 'fraction_numerical': 0.015341701534170154, 'mean_word_length': 6.103960396039604, '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': '2794446', 'n_tokens_mistral': 495, 'n_tokens_neox': 523, 'n_words': 105}