<commit_before>from djangorestframework.permissions import BasePermission
from djangorestframework.response import ErrorResponse
from djangorestframework import status

from devilry.apps.core.models import AssignmentGroup


class GroupResourceHelpersMixin(object):
    def format_user(self, user):
        return {'email': user.email,
                'username': user.username,
                'id': user.id,
                'full_name': user.devilryuserprofile.full_name,
                'displayname': user.devilryuserprofile.full_name or user.username}

    def format_candidate(self, candidate):
        cand = {'id': candidate.id,
                'user': self.format_user(candidate.student),
                'candidate_id': candidate.candidate_id,
                'identifier': candidate.identifier}
        return cand

    def format_examiner(self, examiner):
        cand = {'id': examiner.id,
                'user': self.format_user(examiner.user)}
        return cand<commit_msg>devilry_student.rest.helpers: Removed identifier from the output.<commit_after>from djangorestframework.permissions import BasePermission
from djangorestframework.response import ErrorResponse
from djangorestframework import status

from devilry.apps.core.models import AssignmentGroup


class GroupResourceHelpersMixin(object):
    def format_user(self, user):
        return {'email': user.email,
                'username': user.username,
                'id': user.id,
                'full_name': user.devilryuserprofile.full_name,
                'displayname': user.devilryuserprofile.full_name or user.username}

    def format_candidate(self, candidate):
        cand = {'id': candidate.id,
                'user': self.format_user(candidate.student),
                'candidate_id': candidate.candidate_id}
        return cand

    def format_examiner(self, examiner):
        cand = {'id': examiner.id,
                'user': self.format_user(examiner.user)}
        return cand
{'fraction_non_alphanumeric': 0.09242424242424242, 'fraction_numerical': 0.0, 'mean_word_length': 2.8096153846153844, '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': '1545495', 'n_tokens_mistral': 550, 'n_tokens_neox': 533, 'n_words': 118}