<commit_before>from mongoengine import connect

from hackathon.hmongo.models import User
from hackathon.util import safe_get_config

mongodb_host = safe_get_config("mongodb.host", "localhost")
mongodb_port = safe_get_config("mongodb.port", 27017)
ohp_db = safe_get_config("mongodb.database", "hackathon")

# mongodb client
client = connect(ohp_db, host=mongodb_host, port=mongodb_port)

# mongodb collection for OHP, authentication disabled for now.
db = client[ohp_db]


def drop_db():
    client.drop_database(ohp_db)

<commit_msg>del safe_config : add Config<commit_after>from mongoengine import connect

from hackathon.hmongo.models import User
from hackathon.util import safe_get_config
from hackathon.config import Config

mongodb_host = safe_get_config("mongodb.host", Config.get("scheduler").get("host"))
mongodb_port = safe_get_config("mongodb.port", Config.get("scheduler").get("port"))
ohp_db = safe_get_config("mongodb.database", Config.get("scheduler").get("database"))

# mongodb client
client = connect(ohp_db, host=mongodb_host, port=mongodb_port)

# mongodb collection for OHP, authentication disabled for now.
db = client[ohp_db]


def drop_db():
    client.drop_database(ohp_db)


{'fraction_non_alphanumeric': 0.10842368640533778, 'fraction_numerical': 0.004170141784820684, 'mean_word_length': 7.108108108108108, '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': '4328796', 'n_tokens_mistral': 417, 'n_tokens_neox': 391, 'n_words': 87}