<commit_before># coding=utf-8
VERSION = (1, 0, 0, 'beta', 3)


def get_version(version=None):
    """Derives a PEP386-compliant version number from VERSION."""
    if version is None:
        version = VERSION
    assert len(version) == 5
    assert version[3] in ('alpha', 'beta', 'rc', 'final')

    # Now build the two parts of the version number:
    # main = X.Y[.Z]
    # sub = .devN - for pre-alpha releases
    #     | {a|b|c}N - for alpha, beta and rc releases

    parts = 2 if version[2] == 0 else 3
    main = '.'.join(str(x) for x in version[:parts])

    sub = ''
    if version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[version[3]] + str(version[4])

    return main + sub

__version__ = get_version()


def configure():
    from django.conf import settings as django_settings
    from cio.conf import settings

    # Configure content-io with django settings
    conf = dict(
        ENVIRONMENT={
            'default': {
                'i18n': django_settings.LANGUAGE_CODE,
                'l10n': getattr(django_settings, 'ROOT_URLCONF', 'local').split('.', 1)[0],
                'g11n': 'global'
            }
        },
        CACHE='djedi.backends.django.cache.Backend',
        STORAGE='djedi.backends.django.db.Backend',
        PLUGINS=[
            'cio.plugins.txt.TextPlugin',
            'cio.plugins.md.MarkdownPlugin',
            'djedi.plugins.img.ImagePlugin'
        ],
        THEME='darth'
    )
    conf.update(getattr(django_settings, 'DJEDI', {}))
    settings.configure(conf)<commit_msg>Reload configuration based content-io modules<commit_after># coding=utf-8
VERSION = (1, 0, 0, 'beta', 3)


def get_version(version=None):
    """Derives a PEP386-compliant version number from VERSION."""
    if version is None:
        version = VERSION
    assert len(version) == 5
    assert version[3] in ('alpha', 'beta', 'rc', 'final')

    # Now build the two parts of the version number:
    # main = X.Y[.Z]
    # sub = .devN - for pre-alpha releases
    #     | {a|b|c}N - for alpha, beta and rc releases

    parts = 2 if version[2] == 0 else 3
    main = '.'.join(str(x) for x in version[:parts])

    sub = ''
    if version[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[version[3]] + str(version[4])

    return main + sub

__version__ = get_version()


def configure():
    from django.conf import settings as django_settings
    from cio.conf import settings

    # Configure content-io with django settings
    conf = dict(
        ENVIRONMENT={
            'default': {
                'i18n': django_settings.LANGUAGE_CODE,
                'l10n': getattr(django_settings, 'ROOT_URLCONF', 'local').split('.', 1)[0],
                'g11n': 'global'
            }
        },
        CACHE='djedi.backends.django.cache.Backend',
        STORAGE='djedi.backends.django.db.Backend',
        PLUGINS=[
            'cio.plugins.txt.TextPlugin',
            'cio.plugins.md.MarkdownPlugin',
            'djedi.plugins.img.ImagePlugin'
        ],
        THEME='darth'
    )
    conf.update(getattr(django_settings, 'DJEDI', {}))
    settings.configure(conf)

    # Reload configuration based content-io modules
    from cio.plugins import plugins
    from cio.environment import env
    plugins.load()
    env.reset()
{'fraction_non_alphanumeric': 0.1425595238095238, 'fraction_numerical': 0.01488095238095238, 'mean_word_length': 2.361, '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': '1827338', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1069, 'n_words': 274}