<commit_before>"""
An url to AutocompleteView.

autocomplete_light_autocomplete
    Given a 'autocomplete' argument with the name of the autocomplete, this url
    routes to AutocompleteView.

autocomplete_light_registry
    Renders the autocomplete registry, good for debugging, requires being
    authenticated as superuser.
"""
from django import VERSION

from .views import AutocompleteView, RegistryView

try:
    from django.conf.urls import patterns, url
except ImportError:
    # Django < 1.5
    from django.conf.urls.defaults import patterns, url

urlpatterns = [
    url(r'^(?P<autocomplete>[-\w]+)/$',
        AutocompleteView.as_view(),
        name='autocomplete_light_autocomplete'
    ),
    url(r'^$',
        RegistryView.as_view(),
        name='autocomplete_light_registry'
    ),
]

if VERSION < (1, 9):
    urlpatterns = patterns('', *urlpatterns)
<commit_msg>Fix Django 1.9 import error<commit_after>"""
An url to AutocompleteView.

autocomplete_light_autocomplete
    Given a 'autocomplete' argument with the name of the autocomplete, this url
    routes to AutocompleteView.

autocomplete_light_registry
    Renders the autocomplete registry, good for debugging, requires being
    authenticated as superuser.
"""
from django import VERSION

from .views import AutocompleteView, RegistryView

if VERSION > (1, 9):
    from django.conf.urls import url
else:
    try:
        from django.conf.urls import patterns, url
    except ImportError:
        # Django < 1.5
        from django.conf.urls.defaults import patterns, url

urlpatterns = [
    url(r'^(?P<autocomplete>[-\w]+)/$',
        AutocompleteView.as_view(),
        name='autocomplete_light_autocomplete'
    ),
    url(r'^$',
        RegistryView.as_view(),
        name='autocomplete_light_registry'
    ),
]

if VERSION < (1, 9):
    urlpatterns = patterns('', *urlpatterns)

{'fraction_non_alphanumeric': 0.09828141783029001, 'fraction_numerical': 0.00644468313641246, 'mean_word_length': 3.5661764705882355, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, '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': '4196259', 'n_tokens_mistral': 597, 'n_tokens_neox': 555, 'n_words': 157}