<commit_before># -*- coding: utf-8 -*-


__title__ = 'czech-holidays'
__version__ = '0.0.2'
__author__ = '<NAME>'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 <NAME>'


from datetime import date, timedelta
from dateutil.easter import easter as calculate_easter


__all__ = ('Holiday', 'Holidays', 'holidays')


class Holiday(date):

    def __new__(cls, year, month, day, name, name_en):
        obj = date.__new__(cls, year, month, day)
        obj.name = name
        obj.name_en = name_en
        return obj


class Holidays(list):

    def __init__(self, year=None):
        year = year or date.today().year
        easter = calculate_easter(year) + timedelta(1)

        self.extend((
            Holiday(
                year, 1, 1,
                u"Nový rok",
                u"New Year's Day",
            ),
            Holiday(
                year, 1, 1,
                u"Den obnovy samostatného českého státu",
                u"Restoration Day of the Independent Czech State",
            ),
            Holiday(
                easter.year, easter.month, easter.day,
                u"Velikonoční pondělí",
                u"Easter Monday",
            ),
            Holiday(
                year, 5, 1,
                u"Svátek práce",
                u"Labour Day",
            ),
            Holiday(
                year, 5, 8,
                u"Den vítězství",
                u"Liberation Day",
            ),
            Holiday(
                year, 7, 5,
                u"Den slovanských věrozvěstů Cyrila a Metoděje",
                u"Saints Cyril and Methodius Day",
            ),
            Holiday(
                year, 7, 6,
                u"Den upálení mistra Jana Husa",
                u"Jan Hus Day",
            ),
            Holiday(
                year, 9, 28,
                u"Den české státnosti",
                u"St. Wenceslas Day (Czech Statehood Day)",
            ),
            Holiday(
                year, 10, 28,
                u"Den vzniku samostatného československého státu",
                u"Independent Czechoslovak State Day",
            ),
            Holiday(
                year, 11, 17,
                u"Den boje za svobodu a demokracii",
                u"Struggle for Freedom and Democracy Day",
            ),
            Holiday(
                year, 12, 24,
                u"Štědrý den",
                u"Christmas Eve",
            ),
            Holiday(
                year, 12, 25,
                u"1. svátek vánoční",
                u"Christmas Day",
            ),
            Holiday(
                year, 12, 26,
                u"2. svátek vánoční",
                u"St. Stephen's Day (The Second Christmas Day)",
            ),
        ))

        self.easter = self[2]
        self.christmas = self[10]


holidays = Holidays()<commit_msg>Fixed unicode literals.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals


__title__ = 'czech-holidays'
__version__ = '0.0.2'
__author__ = '<NAME>'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 <NAME>'


from datetime import date, timedelta
from dateutil.easter import easter as calculate_easter


__all__ = ('Holiday', 'Holidays', 'holidays')


class Holiday(date):

    def __new__(cls, year, month, day, name, name_en):
        obj = date.__new__(cls, year, month, day)
        obj.name = name
        obj.name_en = name_en
        return obj


class Holidays(list):

    def __init__(self, year=None):
        year = year or date.today().year
        easter = calculate_easter(year) + timedelta(1)

        self.extend((
            Holiday(
                year, 1, 1,
                "Nový rok",
                "New Year's Day",
            ),
            Holiday(
                year, 1, 1,
                "Den obnovy samostatného českého státu",
                "Restoration Day of the Independent Czech State",
            ),
            Holiday(
                easter.year, easter.month, easter.day,
                "Velikonoční pondělí",
                "Easter Monday",
            ),
            Holiday(
                year, 5, 1,
                "Svátek práce",
                "Labour Day",
            ),
            Holiday(
                year, 5, 8,
                "Den vítězství",
                "Liberation Day",
            ),
            Holiday(
                year, 7, 5,
                "Den slovanských věrozvěstů Cyrila a Metoděje",
                "Saints Cyril and Methodius Day",
            ),
            Holiday(
                year, 7, 6,
                "Den upálení mistra <NAME>",
                "Jan Hus Day",
            ),
            Holiday(
                year, 9, 28,
                "Den české státnosti",
                "St. Wenceslas Day (Czech Statehood Day)",
            ),
            Holiday(
                year, 10, 28,
                "Den vzniku samostatného československého státu",
                "Independent Czechoslovak State Day",
            ),
            Holiday(
                year, 11, 17,
                "Den boje za svobodu a demokracii",
                "Struggle for Freedom and Democracy Day",
            ),
            Holiday(
                year, 12, 24,
                "Štědrý den",
                "Christmas Eve",
            ),
            Holiday(
                year, 12, 25,
                "1. svátek vánoční",
                "Christmas Day",
            ),
            Holiday(
                year, 12, 26,
                "2. svátek vánoční",
                "St. Stephen's Day (The Second Christmas Day)",
            ),
        ))

        self.easter = self[2]
        self.christmas = self[10]


holidays = Holidays()
{'fraction_non_alphanumeric': 0.09613027490807215, 'fraction_numerical': 0.017159866923481003, 'mean_word_length': 1.171037628278221, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '759970', 'n_tokens_mistral': 1826, 'n_tokens_neox': 1641, 'n_words': 440}