<commit_before>import os
import sys

try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse


BASE_DIR = os.path.dirname(__file__)

SYNC_TIMEOUT = 10
DATABASE = {
    'host': os.environ.get('POSTGRES_HOST', 'localhost'),
    'port': os.environ.get('POSTGRES_PORT', 5432),
    'database': os.environ.get('POSTGRES_DB', 'auto_collector'),
    'user': os.environ.get('POSTGRES_USER', 'auto_collector'),
    'password': os.environ.get('POSTGRES_PASSWORD', 'auto_collector'),
}

if 'DATABASE_URL' in os.environ:
    url = urlparse(os.environ['DATABASE_URL'])

    DATABASE = {
        'host': url.hostname,
        'port': url.port,
        'database': url.path[1:],
        'user': url.username,
        'password': <PASSWORD>,
    }

SITE_ADDR = os.environ.get('SITE_ADDR', '0.0.0.0')
SITE_PORT = os.environ.get('SITE_PORT', 80)

TEMPLATE_DIR = os.path.join(BASE_DIR, 'auto', 'templates')
STATIC_URL = 'http://127.0.0.1:8081/'

SHORTENER_API_URL = 'https://www.googleapis.com/urlshortener/v1/url'
SHORTENER_API_KEY = ''
SHORTENER_MAX_REQUESTS_PER_SECOND = 1

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(asctime)s [%(levelname)s] - %(message)s'
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple',
            'stream': sys.stdout,
        },
        'file': {
            'level': 'ERROR',
            'class': 'logging.FileHandler',
            'formatter': 'verbose',
            'filename': os.path.join(BASE_DIR, 'logs', 'error.log')
        },<commit_msg>STATIC_URL from environment<commit_after>import os
import sys

try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse


BASE_DIR = os.path.dirname(__file__)

SYNC_TIMEOUT = 10
DATABASE = {
    'host': os.environ.get('POSTGRES_HOST', 'localhost'),
    'port': os.environ.get('POSTGRES_PORT', 5432),
    'database': os.environ.get('POSTGRES_DB', 'auto_collector'),
    'user': os.environ.get('POSTGRES_USER', 'auto_collector'),
    'password': <PASSWORD>('POSTGRES_PASSWORD', '<PASSWORD>_collector'),
}

if 'DATABASE_URL' in os.environ:
    url = urlparse(os.environ['DATABASE_URL'])

    DATABASE = {
        'host': url.hostname,
        'port': url.port,
        'database': url.path[1:],
        'user': url.username,
        'password': <PASSWORD>,
    }

SITE_ADDR = os.environ.get('SITE_ADDR', '0.0.0.0')
SITE_PORT = os.environ.get('SITE_PORT', 80)

TEMPLATE_DIR = os.path.join(BASE_DIR, 'auto', 'templates')
STATIC_URL = '{static_protocol}://{static_host}:{static_port}/'.format(
    static_protocol=os.environ.get('STATIC_PROTOCOL', 'http'),
    static_host=os.environ.get('STATIC_HOST', '127.0.0.1'),
    static_port=os.environ.get('STATIC_PORT', '8081'),
)

SHORTENER_API_URL = 'https://www.googleapis.com/urlshortener/v1/url'
SHORTENER_API_KEY = ''
SHORTENER_MAX_REQUESTS_PER_SECOND = 1

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(asctime)s [%(levelname)s] - %(message)s'
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple',
            'stream': sys.stdout,
        },
        'file': {
            'level': 'ERROR',
            'class': 'logging.FileHandler',
            'formatter': 'verbose',
            'filename': os.path.join(BASE_DIR, 'logs', 'error.log')
        },
{'fraction_non_alphanumeric': 0.17616846430405753, 'fraction_numerical': 0.01335387776065742, 'mean_word_length': 2.9383215369059656, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, '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': '1616876', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1398, 'n_words': 226}