<commit_before># -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MaxValueValidator

# Create your models here.
class Lageruser(AbstractUser):
    language = models.CharField(max_length=3, null=True)
    pagelength = models.IntegerField(validators=[
            MaxValueValidator(250)
        ], default=30)
    def __unicode__(self):
        if self.first_name != "" and self.last_name != "":
            return u"{0} {1}".format(self.first_name, self.last_name)
        else:
            return self.username

    class Meta:
        verbose_name = _('User')
        verbose_name_plural = _('Users')<commit_msg>restrict language selection to available languages<commit_after># -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import ugettext_lazy as _
from django.core.validators import MaxValueValidator
from django.conf import settings

# Create your models here.
class Lageruser(AbstractUser):
    language = models.CharField(max_length=10, null=True, choices=settings.LANGUAGES, default=settings.LANGUAGES[0])
    pagelength = models.IntegerField(validators=[
            MaxValueValidator(250)
        ], default=30)
    def __unicode__(self):
        if self.first_name != "" and self.last_name != "":
            return u"{0} {1}".format(self.first_name, self.last_name)
        else:
            return self.username

    class Meta:
        verbose_name = _('User')
        verbose_name_plural = _('Users')
{'fraction_non_alphanumeric': 0.10510328068043742, 'fraction_numerical': 0.012150668286755772, 'mean_word_length': 3.392, 'pattern_counts': {'":': 2, '<': 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': '1824203', 'n_tokens_mistral': 487, 'n_tokens_neox': 469, 'n_words': 114}