<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import date

MALE = 1
FEMALE = 2
GENDER = (MALE, FEMALE)

class Person:
    def __init__(self, family_name, first_name, gender, birthday = date.today()):
        if not family_name or family_name.strip() == "":
            raise RuntimeError("family_name must required.")
        if not first_name or first_name.strip() == "":
            raise RuntimeError("first_name must required.")
        if gender not in GENDER:
            raise RuntimeError("illegal gender.")
        if type(birthday) is not date or birthday > date.today():
            raise RuntimeError("illegal birthday.")

        self._family_name = family_name
        self._first_name = first_name
        self._gender = gender
        self._birthday = birthday

    @property
    def family_name(self):
        """
        苗字
        """
        return self._family_name

    @property
    def first_name(self):
        """
        名前
        """
        return self._first_name

    @property
    def full_name(self):
        """
        氏名
        """
        return self._family_name + self._first_name

    @property
    def gender(self):
        """
        性別
        """
        return self._gender

    @property
    def birthday(self):
        """
        誕生日
        """
        return self._birthday

    def age(self, base_date=date.today()):
        """
        指定された年月日の年齢
        誕生日以前の日付が指定された場合はNoneを返す
        """
        if type(base_date) is not date:
            raise RuntimeError("base_date must be date.")
        if self.birthday > base_date:
            return None

        year_diff = base_date.year - self.birthday.year
        if self.birthday <= base_date.replace(year=self.birthday.year):
            return year_diff
        else:
            return year_diff - 1

    def is_male(self):
        return self.gender is MALE

    def is_female(self):
        return self.gender is FEMALE<commit_msg>update pydoc comments.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import date

MALE = 1
FEMALE = 2
GENDER = (MALE, FEMALE)

class Person:
    def __init__(self, family_name, first_name, gender, birthday = date.today()):
        if not family_name or family_name.strip() == "":
            raise RuntimeError("family_name must required.")
        if not first_name or first_name.strip() == "":
            raise RuntimeError("first_name must required.")
        if gender not in GENDER:
            raise RuntimeError("illegal gender.")
        if type(birthday) is not date or birthday > date.today():
            raise RuntimeError("illegal birthday.")

        self._family_name = family_name
        self._first_name = first_name
        self._gender = gender
        self._birthday = birthday

    @property
    def family_name(self):
        """
        苗字
        """
        return self._family_name

    @property
    def first_name(self):
        """
        名前
        """
        return self._first_name

    @property
    def full_name(self):
        """
        氏名
        """
        return self._family_name + self._first_name

    @property
    def gender(self):
        """
        性別
        """
        return self._gender

    @property
    def birthday(self):
        """
        誕生日
        """
        return self._birthday

    def age(self, base_date=date.today()):
        """
        指定された年月日の年齢
        :param base_date: 年齢計算の対象日 省略時は今日の日付
        :return: 誕生日以前の日付が指定された場合はNoneを返す
        """
        if type(base_date) is not date:
            raise RuntimeError("base_date must be date.")
        if self.birthday > base_date:
            return None

        year_diff = base_date.year - self.birthday.year
        if self.birthday <= base_date.replace(year=self.birthday.year):
            return year_diff
        else:
            return year_diff - 1

    def is_male(self):
        return self.gender is MALE

    def is_female(self):
        return self.gender is FEMALE
{'fraction_non_alphanumeric': 0.09793172190381261, 'fraction_numerical': 0.00199352105656616, 'mean_word_length': 1.8610121168923734, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 7, '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': '6908477', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1204, 'n_words': 294}