<commit_before>from os.path import dirname, join as pathjoin
from web.factspace import Factspace
from web.pubsub import PubSub

with open(pathjoin(dirname(__file__), 'home.html')) as f:
    HOME_HTML = f.read()
CHARSET = 'utf-8'
FACTSPACE = Factspace('postgres://combo:combo@localhost/combo')
PUBSUB = PubSub('amqp://guest:guest@localhost:5672', 'combo')<commit_msg>handle heroku env<commit_after>from os import environ
from os.path import dirname, join as pathjoin
from web.factspace import Factspace
from web.pubsub import PubSub

with open(pathjoin(dirname(__file__), 'home.html')) as f:
    HOME_HTML = f.read()
CHARSET = 'utf-8'

local_factspace_url = 'postgres://combo:combo@localhost/combo'
heroku_factspace_url_var = 'DATABASE_URL'
factspace_url = environ.get(heroku_factspace_url_var, local_factspace_url)
FACTSPACE = Factspace(factspace_url)

local_pubsub_url = 'amqp://guest:guest@localhost:5672'
heroku_pubsub_url_var = 'RABBITMQ_BIGWIG_URL'
pubsub_url = environ.get(heroku_pubsub_url_var, local_pubsub_url)
PUBSUB = PubSub(pubsub_url, 'combo')
{'fraction_non_alphanumeric': 0.11363636363636363, 'fraction_numerical': 0.00946969696969697, 'mean_word_length': 7.322834645669292, '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': '5955582', 'n_tokens_mistral': 398, 'n_tokens_neox': 391, 'n_words': 77}