<commit_before># -*- coding: utf-8 -*-
# Copyright 2016 KMEE - <NAME> <<EMAIL>>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging
import pytz
from dateutil.relativedelta import relativedelta
from openerp import api, fields, models

_logger = logging.getLogger(__name__)

try:
    from pybrasil import feriado
except ImportError:
    _logger.info('Cannot import pybrasil')

_INTERVALS = {
    'days': lambda interval: relativedelta(days=interval),
    'weeks': lambda interval: relativedelta(days=7*interval),
    'months': lambda interval: relativedelta(months=interval),
    'years': lambda interval: relativedelta(months=12*interval),
}


class WorkalendarHolidayImport(models.TransientModel):

    _name = 'wizard.workalendar.holiday.import'

    @api.multi
    @api.depends('start_date', 'interval_number', 'interval_type')
    def _compute_end_date(self):
        for wiz in self:
            wiz.end_date = fields.Date.from_string(wiz.start_date) + \
                _INTERVALS[wiz.interval_type](wiz.interval_number)

    start_date = fields.Date(
        string='Start Date',
        default=fields.Date.today,
        readonly=1,
    )
    end_date = fields.Date(
        string='End Date',
        compute='_compute_end_date'
    )
    interval_number = fields.Integer(
        string='Interval',
        default=1<commit_msg>[FIX] Flake8 Repositorio<commit_after># -*- coding: utf-8 -*-
# Copyright 2016 KMEE - <NAME> <<EMAIL>>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging
import pytz
from dateutil.relativedelta import relativedelta
from openerp import api, fields, models

_logger = logging.getLogger(__name__)

try:
    from pybrasil import feriado
except ImportError:
    _logger.info('Cannot import pybrasil')

_INTERVALS = {
    'days': lambda interval: relativedelta(days=interval),
    'weeks': lambda interval: relativedelta(days=7 * interval),
    'months': lambda interval: relativedelta(months=interval),
    'years': lambda interval: relativedelta(months=12 * interval),
}


class WorkalendarHolidayImport(models.TransientModel):

    _name = 'wizard.workalendar.holiday.import'

    @api.multi
    @api.depends('start_date', 'interval_number', 'interval_type')
    def _compute_end_date(self):
        for wiz in self:
            wiz.end_date = fields.Date.from_string(wiz.start_date) + \
                _INTERVALS[wiz.interval_type](wiz.interval_number)

    start_date = fields.Date(
        string='Start Date',
        default=fields.Date.today,
        readonly=1,
    )
    end_date = fields.Date(
        string='End Date',
        compute='_compute_end_date'
    )
    interval_number = fields.Integer(
        string='Interval',
        default=1
{'fraction_non_alphanumeric': 0.11721878412813978, 'fraction_numerical': 0.009100837277029487, 'mean_word_length': 3.497545008183306, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '526080', 'n_tokens_mistral': 908, 'n_tokens_neox': 874, 'n_words': 179}