<commit_before># coding: utf-8
from __future__ import unicode_literals

"""
django-productline i18n root urlconf

urlpatterns are constructed by refining django_productline.urls.get_urls.

Here, get_urls and get_i18n_patterns is called to get the (composed) urlpatterns.
The i18n_patterns must be defined in the root_urlconf, therefore this refinement is necessary.
"""

from django.conf.urls.i18n import i18n_patterns
from django_productline import urls

urlpatterns = i18n_patterns(*urls.get_urls(), prefix_default_language=True)<commit_msg>improved doc for new root_urlconf<commit_after># coding: utf-8
from __future__ import unicode_literals

"""
django-productline i18n root urlconf

urlpatterns are constructed by refining django_productline.urls.get_urls.

Here, get_urls and get_i18n_patterns is called to get the (composed) urlpatterns.
The i18n_patterns must be defined in the root_urlconf, therefore this refinement is necessary.

When refining get_urls using includes like this
    urlpatterns = original() + url(r'^', include('app.urls'))
and receive errors you might want to access the url_patterns attribute of the include directly
as i18n_patterns() expects a list of url() instances and include returns a Resolver instance.

Like this:

    def refine_get_urls(original):

        def get_urls():
            from django.conf.urls import url, include
            # we need the url_patterns attr as this returns a list of url() instances
            urlpatterns = original() + url(r'^', include('app.urls')).url_patterns
            return urlpatterns

        return get_urls
"""

from django.conf.urls.i18n import i18n_patterns
from django_productline import urls

urlpatterns = i18n_patterns(*urls.get_urls(), prefix_default_language=True)
{'fraction_non_alphanumeric': 0.06655290102389079, 'fraction_numerical': 0.015927189988623434, 'mean_word_length': 4.767213114754099, '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': '7244323', 'n_tokens_mistral': 537, 'n_tokens_neox': 531, 'n_words': 179}