<commit_before>"""Default Contacts settings."""

import os

PLUGIN_BASE_DIR = os.path.dirname(__file__)

CONTACTS_STATS_FILES = {
    "dev": os.path.join(
        PLUGIN_BASE_DIR, "../frontend/webpack-stats.json"),
    "prod": os.path.join(
        PLUGIN_BASE_DIR, "static/modoboa_contacts/webpack-stats.json")
}<commit_msg>Provide default settings from one place.<commit_after>"""Default Contacts settings."""

import os

PLUGIN_BASE_DIR = os.path.dirname(__file__)

CONTACTS_STATS_FILES = {
    "dev": os.path.join(
        PLUGIN_BASE_DIR, "../frontend/webpack-stats.json"),
    "prod": os.path.join(
        PLUGIN_BASE_DIR, "static/modoboa_contacts/webpack-stats.json")
}


def apply(settings):
    """Modify settings."""
    DEBUG = settings['DEBUG']
    settings["INSTALLED_APPS"] += ("webpack_loader", )
    settings["WEBPACK_LOADER"] = {
        'CONTACTS': {
            'CACHE': not DEBUG,
            'BUNDLE_DIR_NAME': 'modoboa_contacts/',
            'STATS_FILE': CONTACTS_STATS_FILES.get("dev" if DEBUG else "prod"),
            'IGNORE': ['.+\.hot-update.js', '.+\.map']
        }
    }
{'fraction_non_alphanumeric': 0.1621376811594203, 'fraction_numerical': 0.0, 'mean_word_length': 3.217557251908397, 'pattern_counts': {'":': 4, '<': 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': '6484241', 'n_tokens_mistral': 393, 'n_tokens_neox': 384, 'n_words': 61}