<commit_before>from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db import models

import settings as app_settings
Section = app_settings.get_extending_model()

class SectionAdmin(admin.ModelAdmin):
    
    list_per_page = 10
    
    def __init__(self, *args, **kwargs):
        from admin_urls import urlpatterns       
        for regex_URL_pattern in urlpatterns:
            if regex_URL_pattern.name == 'related_content':
                regex_URL_pattern.default_args = {
                    'list_per_page': self.list_per_page
                }
        self.urlpatterns = urlpatterns
        self.url_map = dict([(p.name, p.callback) for p in urlpatterns])
        super(SectionAdmin, self).__init__(*args, **kwargs)
    
    def get_urls(self):
        urls = super(SectionAdmin, self).get_urls()
        return self.urlpatterns #+ urls
    
    def changelist_view(self, request):
        index_view = self.url_map['sections_index']
        return index_view(request)
    
    def add_view(self, request):
        from django.views.generic import simple
        return simple.redirect_to(request, '../../') <commit_msg>Removes commented out legacy code<commit_after>from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db import models

import settings as app_settings
Section = app_settings.get_extending_model()

class SectionAdmin(admin.ModelAdmin):
    
    list_per_page = 10
    
    def __init__(self, *args, **kwargs):
        from admin_urls import urlpatterns       
        for regex_URL_pattern in urlpatterns:
            if regex_URL_pattern.name == 'related_content':
                regex_URL_pattern.default_args = {
                    'list_per_page': self.list_per_page
                }
        self.urlpatterns = urlpatterns
        self.url_map = dict([(p.name, p.callback) for p in urlpatterns])
        super(SectionAdmin, self).__init__(*args, **kwargs)
    
    def get_urls(self):
        urls = super(SectionAdmin, self).get_urls()
        return self.urlpatterns
    
    def changelist_view(self, request):
        index_view = self.url_map['sections_index']
        return index_view(request)
    
    def add_view(self, request):
        from django.views.generic import simple
        return simple.redirect_to(request, '../../')
{'fraction_non_alphanumeric': 0.08824777259227833, 'fraction_numerical': 0.0016970725498515061, 'mean_word_length': 2.6728971962616823, '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': '462450', 'n_tokens_mistral': 678, 'n_tokens_neox': 673, 'n_words': 155}