<commit_before>from django.conf.urls.defaults import *
from django.conf import settings
from modoboa.extensions import *
from modoboa.lib import parameters

prefix = settings.MODOBOA_WEBPATH
if prefix != "":
    if prefix.startswith("/"):
        prefix = prefix[1:]
    if not prefix.endswith("/"):
        prefix += "/"

urlpatterns = patterns('',
    (r'^%s$' % prefix, 'modoboa.lib.webutils.topredirection'),
    (r'^%sadmin/' % prefix, include('modoboa.admin.urls')),
    (r'^%suserprefs/' % prefix, include('modoboa.userprefs.urls')),
    (r'^accounts/login/$', 'modoboa.auth.views.dologin'),
    (r'^accounts/logout/$', 'modoboa.auth.views.dologout'),
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', 
     {'packages': ('modoboa',),}),
    *exts_pool.load_all(prefix)
)

if settings.DEBUG:
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    from django.conf.urls.static import static
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
<commit_msg>Special case for the *demo* application.<commit_after>from django.conf.urls.defaults import *
from django.conf import settings
from modoboa.extensions import *
from modoboa.lib import parameters

prefix = settings.MODOBOA_WEBPATH
if prefix != "":
    if prefix.startswith("/"):
        prefix = prefix[1:]
    if not prefix.endswith("/"):
        prefix += "/"

urlpatterns = patterns('',
    (r'^%s$' % prefix, 'modoboa.lib.webutils.topredirection'),
    (r'^%sadmin/' % prefix, include('modoboa.admin.urls')),
    (r'^%suserprefs/' % prefix, include('modoboa.userprefs.urls')),
    (r'^accounts/login/$', 'modoboa.auth.views.dologin'),
    (r'^accounts/logout/$', 'modoboa.auth.views.dologout'),
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', 
     {'packages': ('modoboa',),}),
    *exts_pool.load_all(prefix)
)

if 'modoboa.demo' in settings.INSTALLED_APPS:
    urlpatterns += patterns('',
        (r'%sdemo/' % prefix, include('modoboa.demo.urls'))
    )

if settings.DEBUG:
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    from django.conf.urls.static import static
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

{'fraction_non_alphanumeric': 0.16377063423110338, 'fraction_numerical': 0.004344048653344918, 'mean_word_length': 4.270022883295194, 'pattern_counts': {'":': 2, '<': 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': '7171562', 'n_tokens_mistral': 805, 'n_tokens_neox': 792, 'n_words': 136}