<commit_before>"""Defaults urls for the Zinnia project"""
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns

from django.utils.translation import ugettext_lazy

from zinnia.settings import TRANSLATED_URLS


def i18n_url(url, translate=TRANSLATED_URLS):
    """
    Translate or not an URL part.
    """
    if translate:
        return ugettext_lazy(url)
    return url

_ = i18n_url

urlpatterns = patterns(
    '',
    url(_(r'^feeds/'), include('zinnia.urls.feeds')),
    url(_(r'^tags/'), include('zinnia.urls.tags',)),
    url(_(r'^authors/'), include('zinnia.urls.authors')),
    url(_(r'^categories/'), include('zinnia.urls.categories')),
    url(_(r'^search/'), include('zinnia.urls.search')),
    url(_(r'^random/'), include('zinnia.urls.random')),
    url(_(r'^sitemap/'), include('zinnia.urls.sitemap')),
    url(_(r'^trackback/'), include('zinnia.urls.trackback')),
    url(_(r'^comments/'), include('zinnia.urls.comments')),
    url(r'^', include('zinnia.urls.entries')),
    url(r'^', include('zinnia.urls.archives')),
    url(r'^', include('zinnia.urls.shortlink')),
    url(r'^', include('zinnia.urls.quick_entry')),
    url(r'^', include('zinnia.urls.capabilities')),
)
<commit_msg>Include the URLs of Zinnia under "zinnia" application and instance namespace by default to prevent backward compatibility<commit_after>"""Defaults urls for the Zinnia project"""
from django.conf.urls import url
from django.conf.urls import patterns
from django.conf.urls import include as default_include

from django.utils.translation import ugettext_lazy

from zinnia.settings import TRANSLATED_URLS


def i18n_url(url, translate=TRANSLATED_URLS):
    """
    Translate or not an URL part.
    """
    if translate:
        return ugettext_lazy(url)
    return url

_ = i18n_url


def namespace_include(patterns, namespace='zinnia', app_name='zinnia'):
    """
    Include urlpatterns under the default 'zinnia'
    instance and application namespaces.
    """
    return default_include(patterns, namespace=namespace, app_name=app_name)

include = namespace_include

urlpatterns = patterns(
    '',
    url(_(r'^feeds/'), include('zinnia.urls.feeds')),
    url(_(r'^tags/'), include('zinnia.urls.tags',)),
    url(_(r'^authors/'), include('zinnia.urls.authors')),
    url(_(r'^categories/'), include('zinnia.urls.categories')),
    url(_(r'^search/'), include('zinnia.urls.search')),
    url(_(r'^random/'), include('zinnia.urls.random')),
    url(_(r'^sitemap/'), include('zinnia.urls.sitemap')),
    url(_(r'^trackback/'), include('zinnia.urls.trackback')),
    url(_(r'^comments/'), include('zinnia.urls.comments')),
    url(r'^', include('zinnia.urls.entries')),
    url(r'^', include('zinnia.urls.archives')),
    url(r'^', include('zinnia.urls.shortlink')),
    url(r'^', include('zinnia.urls.quick_entry')),
    url(r'^', include('zinnia.urls.capabilities')),
)

{'fraction_non_alphanumeric': 0.1806077159440082, 'fraction_numerical': 0.0027313076135199728, 'mean_word_length': 4.790513833992095, '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': '7356647', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1039, 'n_words': 182}