<commit_before>from __future__ import unicode_literals
from django.views.generic import TemplateView

from django_cradmin import crapp
from django_cradmin.viewhelpers.detail import DetailRoleView
from devilry.apps.core import models as coremodels


class Overview(DetailRoleView):
    model = coremodels.Assignment
    context_object_name = "assignment"
    template_name = 'devilry_admin/assignment/overview.django.html'

    def get_context_data(self, **kwargs):
        assignment = self.get_object()
        context = super(Overview, self).get_context_data(**kwargs)
        context['assignmentgroups_count'] = assignment.assignmentgroups.count()
        context['candidates_count'] = coremodels.Candidate.objects.filter(assignment_group__parentnode=assignment).count()
        context['administrator_count'] = len(assignment.get_all_admins())<commit_msg>admin: Fixed pep8 errors.<commit_after>from __future__ import unicode_literals

from django_cradmin import crapp
from django_cradmin.viewhelpers.detail import DetailRoleView

from devilry.apps.core import models as coremodels


class Overview(DetailRoleView):
    model = coremodels.Assignment
    context_object_name = "assignment"
    template_name = 'devilry_admin/assignment/overview.django.html'

    def get_context_data(self, **kwargs):
        assignment = self.get_object()
        context = super(Overview, self).get_context_data(**kwargs)
        context['assignmentgroups_count'] = assignment.assignmentgroups.count()
        context['candidates_count'] = coremodels.Candidate.objects.filter(
            assignment_group__parentnode=assignment).count()
        context['administrator_count'] = len(assignment.get_all_admins())
{'fraction_non_alphanumeric': 0.0895170789163722, 'fraction_numerical': 0.0005889281507656066, 'mean_word_length': 5.178181818181818, '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': '5038456', 'n_tokens_mistral': 484, 'n_tokens_neox': 475, 'n_words': 87}