<commit_before>from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import lazy

try:
    from django.conf.urls import patterns, url
except:
    from django.conf.urls.defaults import patterns, url

from ella.core.custom_urls import resolver

from ella_galleries.views import gallery_item_detail
from ella_galleries.models import Gallery

lazy_slugify = lazy(slugify, str)
lazy_regex = lazy(lambda regex, res_dict: regex % res_dict, str)

res = {
    'item_slug': r'(?P<item_slug>[\w-]+)',
    'url_remainder': r'(?P<url_remainder>.+/)',
    'item_prefix': lazy_slugify(_('Item')),
}

lazy_regex(r'^%(item_prefix)s/%(item_slug)s/%(url_remainder)s$', res)

urlpatterns = patterns(
    '',
    url(lazy_regex(r'^%(item_prefix)s/%(item_slug)s/%(url_remainder)s$', res), gallery_item_detail, name='gallery-item-detail-custom'),
    url(lazy_regex(r'^%(item_prefix)s/%(item_slug)s/$', res), gallery_item_detail, name='gallery-item-detail'),
)

resolver.register(urlpatterns, model=Gallery)
resolver.register_custom_detail(Gallery, gallery_item_detail)
<commit_msg>removed meaningless line in urls.py<commit_after>from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import lazy

try:
    from django.conf.urls import patterns, url
except:
    from django.conf.urls.defaults import patterns, url

from ella.core.custom_urls import resolver

from ella_galleries.views import gallery_item_detail
from ella_galleries.models import Gallery

lazy_slugify = lazy(slugify, str)
lazy_regex = lazy(lambda regex, res_dict: regex % res_dict, str)

res = {
    'item_slug': r'(?P<item_slug>[\w-]+)',
    'url_remainder': r'(?P<url_remainder>.+/)',
    'item_prefix': lazy_slugify(_('Item')),
}


urlpatterns = patterns(
    '',
    url(lazy_regex(r'^%(item_prefix)s/%(item_slug)s/%(url_remainder)s$', res), gallery_item_detail, name='gallery-item-detail-custom'),
    url(lazy_regex(r'^%(item_prefix)s/%(item_slug)s/$', res), gallery_item_detail, name='gallery-item-detail'),
)

resolver.register(urlpatterns, model=Gallery)
resolver.register_custom_detail(Gallery, gallery_item_detail)

{'fraction_non_alphanumeric': 0.13831692032229184, 'fraction_numerical': 0.0, 'mean_word_length': 6.303921568627451, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1642662', 'n_tokens_mistral': 793, 'n_tokens_neox': 794, 'n_words': 142}