<commit_before>from django.conf.urls import url
from django.template.response import TemplateResponse


class AdminController(object):
    model = None

    def get_actions(self):
        return {
            'list': self.list,
            'detail': self.detail,
            'create': self.create,
        }

    def get_template_names(self, action):
        template_names = {
            'list': 'admin_crud/list.html',
            'detail': 'admin_crud/detail.html',
            'create': 'admin_crud/create.html',
        }

        return template_names[action]

    def get_context_data(self):
        data = {}
        return data
    
    def list(self, request, *args, **kwargs):
        template = self.get_template_names('list')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def create(self, request, *args, **kwargs):
        template = self.get_template_names('create')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def detail(self, request, *args, **kwargs):
        template = self.get_template_names('detail')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def get_urls(self, **kwargs):
        """
        Generate urls for any available actions
        """
        return [
            url(r'^$', self.list),
            url(r'^create/$', self.create),
            url(r'^(?<pk>\d+)/$', self.detail),
        ]<commit_msg>Add a dummy update action<commit_after>from django.conf.urls import url
from django.template.response import TemplateResponse


class AdminController(object):
    model = None

    def get_actions(self):
        return {
            'list': self.list,
            'detail': self.detail,
            'create': self.create,
            'update': self.update,
        }

    def get_template_names(self, action):
        template_names = {
            'list': 'admin_crud/list.html',
            'detail': 'admin_crud/detail.html',
            'create': 'admin_crud/create.html',
            'update': 'admin_crud/update.html',
        }

        return template_names[action]

    def get_context_data(self):
        data = {}
        return data
    
    def list(self, request, *args, **kwargs):
        template = self.get_template_names('list')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def create(self, request, *args, **kwargs):
        template = self.get_template_names('create')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def detail(self, request, *args, **kwargs):
        template = self.get_template_names('detail')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def update(self, request, *args, **kwargs):
        template = self.get_template_names('update')
        context = self.get_context_data()
        return TemplateResponse(request, template, context)

    def get_urls(self, **kwargs):
        """
        Generate urls for any available actions
        """
        return [
            url(r'^$', self.list),
            url(r'^create/$', self.create),
            url(r'^(?P<pk>\d+)/$', self.detail),
            url(r'^(?P<pk>\d+)/update/$', self.update),
        ]
{'fraction_non_alphanumeric': 0.12705882352941175, 'fraction_numerical': 0.0, 'mean_word_length': 2.354043392504931, 'pattern_counts': {'":': 0, '<': 6, '<?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': '778492', 'n_tokens_mistral': 967, 'n_tokens_neox': 949, 'n_words': 209}