<commit_before>class BackboneSite(object):

    def __init__(self, name='backbone'):
        self._registry = []
        self.name = name

    def register(self, backbone_view_class):
        """
        Registers the given backbone view class.
        """
        if backbone_view_class not in self._registry:
            self._registry.append(backbone_view_class)

    def unregister(self, backbone_view_class):
        if backbone_view_class in self._registry:
            self._registry.remove(backbone_view_class)

    def get_urls(self):
        from django.conf.urls import patterns, url

        urlpatterns = patterns('')
        for view_class in self._registry:
            app_label = view_class.model._meta.app_label
            module_name = view_class.model._meta.module_name

            url_path_prefix = r'^%s/%s' % (app_label, module_name)
            base_url_name = '%s_%s' % (app_label, module_name)

            urlpatterns += patterns('',
                url(url_path_prefix + '$', view_class.as_view(), name=base_url_name),
                url(url_path_prefix + '/(?P<id>\d+)$', view_class.as_view(),
                    name=base_url_name + '_detail')
            )
        return urlpatterns

    @property
    def urls(self):
        return (self.get_urls(), 'backbone', self.name)<commit_msg>Changes url imports to make it compatible with django 1.3+<commit_after>class BackboneSite(object):

    def __init__(self, name='backbone'):
        self._registry = []
        self.name = name

    def register(self, backbone_view_class):
        """
        Registers the given backbone view class.
        """
        if backbone_view_class not in self._registry:
            self._registry.append(backbone_view_class)

    def unregister(self, backbone_view_class):
        if backbone_view_class in self._registry:
            self._registry.remove(backbone_view_class)

    def get_urls(self):
        from django.conf.urls.defaults import patterns, url

        urlpatterns = patterns('')
        for view_class in self._registry:
            app_label = view_class.model._meta.app_label
            module_name = view_class.model._meta.module_name

            url_path_prefix = r'^%s/%s' % (app_label, module_name)
            base_url_name = '%s_%s' % (app_label, module_name)

            urlpatterns += patterns('',
                url(url_path_prefix + '$', view_class.as_view(), name=base_url_name),
                url(url_path_prefix + '/(?P<id>\d+)$', view_class.as_view(),
                    name=base_url_name + '_detail')
            )
        return urlpatterns

    @property
    def urls(self):
        return (self.get_urls(), 'backbone', self.name)
{'fraction_non_alphanumeric': 0.10793768545994065, 'fraction_numerical': 0.000741839762611276, 'mean_word_length': 2.3796992481203008, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '608486', 'n_tokens_mistral': 818, 'n_tokens_neox': 785, 'n_words': 158}