<commit_before>import os.path
import blackhouse.api as black_house
import logging
# import blackhouse.assistant
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)

certificate_file = black_house.blackhouse_configuration_directory + '/ssl/cert.pem'
certificate_key = black_house.blackhouse_configuration_directory + '/ssl/cert.key'
if os.path.isfile(certificate_file) and os.path.isfile(certificate_key):
    logging.info("Certificates found. Trying to run in SSL mode")
    # order matters
    context = (certificate_file, certificate_key)
    black_house.app.run(debug=False, host="0.0.0.0", ssl_context=context, port=5001)
else:
    logging.info("No certificates found in SSL configuration folder. Running insecure socket mode")
    black_house.app.run(debug=False, host="0.0.0.0", port=5000)

# blackhouse.assistant.start_assistant()<commit_msg>Added configuration directory autocreation in runtime<commit_after>import os.path
import blackhouse.api as black_house
import logging
# import blackhouse.assistant
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)

if not os.path.isdir(black_house.blackhouse_configuration_directory):
    os.mkdir(black_house.blackhouse_configuration_directory)
certificate_file = black_house.blackhouse_configuration_directory + '/ssl/cert.pem'
certificate_key = black_house.blackhouse_configuration_directory + '/ssl/cert.key'
if os.path.isfile(certificate_file) and os.path.isfile(certificate_key):
    logging.info("Certificates found. Trying to run in SSL mode")
    # order matters
    context = (certificate_file, certificate_key)
    black_house.app.run(debug=False, host="0.0.0.0", ssl_context=context, port=5001)
else:
    logging.info("No certificates found in SSL configuration folder. Running insecure socket mode")
    black_house.app.run(debug=False, host="0.0.0.0", port=5000)

# blackhouse.assistant.start_assistant()
{'fraction_non_alphanumeric': 0.1156773211567732, 'fraction_numerical': 0.016235413495687467, 'mean_word_length': 6.068100358422939, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2840354', 'n_tokens_mistral': 637, 'n_tokens_neox': 617, 'n_words': 124}