<commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _

from persons.constants import PersonGender, PersonReligion


class Person(models.Model):
    first_name = models.CharField(_('first name'), max_length=50)
    last_name = models.CharField(_('last name'), max_length=50)
    birth_date = models.DateField(_('birth date'), null=True, blank=True)
    date_of_death = models.DateField(_('date of death'), null=True, blank=True)
    birth_place = models.CharField(_('birth place'), max_length=100,
                                   blank=True)
    address = models.CharField(_('address'), max_length=200, blank=True)
    postcode = models.CharField(_('postcode'), max_length=10, blank=True,
                                help_text=_('(e.g.:1234 AB)'))

    phone = models.CharField(_('phone'), max_length=20, blank=True)
    mobile = models.CharField(_('mobile'), max_length=20, blank=True)

    gender = models.PositiveSmallIntegerField(
        _('gender'),
        help_text=_('Indicates the gender of the user.'),
        choices=PersonGender.GENDER_OPTIONS,
        default=PersonGender.NOT_SPECIFIED)
    religion = models.PositiveSmallIntegerField(
        _('religion'),
        help_text=_('Indicates the religion of the user.'),
        choices=PersonReligion.RELIGION_OPTIONS,
        default=PersonReligion.NOT_SPECIFIED)
    is_deceased = models.BooleanField(_('is deceased'), default=False,
                                      blank=True)

    def __str__(self):
        return "{} {}".format(self.first_name, self.last_name)

    @property
    def full_name(self):
        return "{} {}".format(self.first_name, self.last_name)

    def save(self, *args, **kwargs):
        if any([self.is_deceased, self.date_of_death]):
            raise ValueError("If the person died you must"
                             "supply the date of death")
        return super().save(args, kwargs)
<commit_msg>any([false, false]) intra pe conditie -> nu putem adauga vi<commit_after>from django.db import models
from django.utils.translation import ugettext_lazy as _

from persons.constants import PersonGender, PersonReligion


class Person(models.Model):
    first_name = models.CharField(_('first name'), max_length=50)
    last_name = models.CharField(_('last name'), max_length=50)
    birth_date = models.DateField(_('birth date'), null=True, blank=True)
    date_of_death = models.DateField(_('date of death'), null=True, blank=True)
    birth_place = models.CharField(_('birth place'), max_length=100,
                                   blank=True)
    address = models.CharField(_('address'), max_length=200, blank=True)
    postcode = models.CharField(_('postcode'), max_length=10, blank=True,
                                help_text=_('(e.g.:1234 AB)'))

    phone = models.CharField(_('phone'), max_length=20, blank=True)
    mobile = models.CharField(_('mobile'), max_length=20, blank=True)

    gender = models.PositiveSmallIntegerField(
        _('gender'),
        help_text=_('Indicates the gender of the user.'),
        choices=PersonGender.GENDER_OPTIONS,
        default=PersonGender.NOT_SPECIFIED)
    religion = models.PositiveSmallIntegerField(
        _('religion'),
        help_text=_('Indicates the religion of the user.'),
        choices=PersonReligion.RELIGION_OPTIONS,
        default=PersonReligion.NOT_SPECIFIED)
    is_deceased = models.BooleanField(_('is deceased'), default=False,
                                      blank=True)

    def __str__(self):
        return "{} {}".format(self.first_name, self.last_name)

    @property
    def full_name(self):
        return "{} {}".format(self.first_name, self.last_name)

    def save(self, *args, **kwargs):
        if bool(self.is_deceased) != bool(self.date_of_death):
            raise ValueError("If the person died you must"
                             "supply the date of death")
        return super().save(args, kwargs)

{'fraction_non_alphanumeric': 0.12301487269977313, 'fraction_numerical': 0.01008318628686665, 'mean_word_length': 3.0739219712525667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2953930', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1161, 'n_words': 244}