<commit_before># -*- coding: utf-8 -*-
import sys
from copy import copy
from django.conf.urls import include, url
from django_js_reverse.views import urls_js

if sys.version < '3':
    import codecs


    def u(x):
        return codecs.unicode_escape_decode(x)[0]
else:
    def u(x):
        return x


def dummy_view(*args, **kwargs):
    pass


basic_patterns = [
    url(r'^jsreverse/$', urls_js, name='js_reverse'),

    # test urls
    url(r'^test_no_url_args/$', dummy_view,
        name='test_no_url_args'),
    url(r'^test_one_url_args/(?P<arg_one>[-\w]+)/$', dummy_view,
        name='test_one_url_args'),
    url(r'^test_two_url_args/(?P<arg_one>[-\w]+)-(?P<arg_two>[-\w]+)/$', dummy_view,
        name='test_two_url_args'),
    url(r'^test_optional_url_arg/(?:1_(?P<arg_one>[-\w]+)-)?2_(?P<arg_two>[-\w]+)/$', dummy_view,
        name='test_optional_url_arg'),
    url(r'^test_unicode_url_name/$', dummy_view,
        name=u('test_unicode_url_name')),
    url(r'^test_duplicate_name/(?P<arg_one>[-\w]+)/$', dummy_view,
        name='test_duplicate_name'),
    url(r'^test_duplicate_name/(?P<arg_one>[-\w]+)-(?P<arg_two>[-\w]+)/$', dummy_view,
        name='test_duplicate_name'),
    url(r'^test_duplicate_argcount/(?P<arg_one>[-\w]+)?-(?P<arg_two>[-\w]+)?/$', dummy_view,
        name='test_duplicate_argcount'),
]

urlpatterns = copy(basic_patterns)

# test exclude namespaces urls
urlexclude = [
    url(r'^test_exclude_namespace/$', dummy_view,
        name='test_exclude_namespace_url1')
]

# test namespace
pattern_ns_1 = [
    url(r'', include(basic_patterns))
]

pattern_ns_2 = [
    url(r'', include(basic_patterns))
]

pattern_ns_arg = [
    url(r'', include(basic_patterns))
]

pattern_nested_ns = [
    url(r'^ns1/', include(pattern_ns_1, namespace='ns1'))
]<commit_msg>pep8 test urls (line length)<commit_after># -*- coding: utf-8 -*-
import sys
from copy import copy
from django.conf.urls import include, url
from django_js_reverse.views import urls_js

if sys.version < '3':
    import codecs


    def u(x):
        return codecs.unicode_escape_decode(x)[0]
else:
    def u(x):
        return x


def dummy_view(*args, **kwargs):
    pass


basic_patterns = [
    url(r'^jsreverse/$', urls_js, name='js_reverse'),

    # test urls
    url(r'^test_no_url_args/$', dummy_view, name='test_no_url_args'),
    url(r'^test_one_url_args/(?P<arg_one>[-\w]+)/$', dummy_view, name='test_one_url_args'),
    url(r'^test_two_url_args/(?P<arg_one>[-\w]+)-(?P<arg_two>[-\w]+)/$', dummy_view, name='test_two_url_args'),
    url(r'^test_optional_url_arg/(?:1_(?P<arg_one>[-\w]+)-)?2_(?P<arg_two>[-\w]+)/$', dummy_view,
        name='test_optional_url_arg'),
    url(r'^test_unicode_url_name/$', dummy_view, name=u('test_unicode_url_name')),
    url(r'^test_duplicate_name/(?P<arg_one>[-\w]+)/$', dummy_view, name='test_duplicate_name'),
    url(r'^test_duplicate_name/(?P<arg_one>[-\w]+)-(?P<arg_two>[-\w]+)/$', dummy_view, name='test_duplicate_name'),
    url(r'^test_duplicate_argcount/(?P<arg_one>[-\w]+)?-(?P<arg_two>[-\w]+)?/$', dummy_view,
        name='test_duplicate_argcount'),

]

urlpatterns = copy(basic_patterns)

# test exclude namespaces urls
urlexclude = [
    url(r'^test_exclude_namespace/$', dummy_view,
        name='test_exclude_namespace_url1')
]

# test namespace
pattern_ns_1 = [
    url(r'', include(basic_patterns))
]

pattern_ns_2 = [
    url(r'', include(basic_patterns))
]

pattern_ns_arg = [
    url(r'', include(basic_patterns))
]

pattern_nested_ns = [
    url(r'^ns1/', include(pattern_ns_1, namespace='ns1'))
]
{'fraction_non_alphanumeric': 0.19516310461192352, 'fraction_numerical': 0.0064679415073115865, 'mean_word_length': 4.506191950464396, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, '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': '2085628', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1390, 'n_words': 186}