<commit_before># See LICENSE file for full copyright and licensing details.

import time
from datetime import datetime
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from dateutil.relativedelta import relativedelta
from dateutil import parser
from odoo import api, fields, models


class FolioReport(models.AbstractModel):
    _name = 'report.hotel.report_hotel_folio'

    def get_data(self, date_start, date_end):
        total_amount = 0.0
        data_folio = []
        folio_obj = self.env['hotel.folio']
        act_domain = [('checkin_date', '>=', date_start),
                      ('checkout_date', '<=', date_end)]
        tids = folio_obj.search(act_domain)
        for data in tids:
            data_folio.append({'name': data.name,
                               'partner': data.partner_id.name,
                               'checkin': parser.parse(data.checkin_date).
                               strftime(DEFAULT_SERVER_DATETIME_FORMAT),
                               'checkout': parser.parse(data.checkout_date).
                               strftime(DEFAULT_SERVER_DATETIME_FORMAT),
                               'amount': data.amount_total})
            total_amount += data.amount_total
        data_folio.append({'total_amount': total_amount})
        return data_folio

    @api.model
    def get_report_values(self, docids, data):
        self.model = self.env.context.get('active_model')
        if data is None:
            data = {}
        if not docids:
            docids = data['form'].get('docids')
        folio_profile = self.env['hotel.folio'].browse(docids)
        date_start = data['form'].get('date_start', fields.Date.today())
        date_end = data['form'].get('date_end', str(datetime.now() +
                                    relativedelta(months=+1,
                                                  day=1, days=-1))[:10])
        return {
            'doc_ids': docids,
            'doc_model': self.model,
            'data': data['form'],
            'docs': folio_profile,
            'time': time,
            'folio_data': self.get_data(date_start, date_end)
        }
<commit_msg>[IMP]Made Changes in Code Readiblity<commit_after># See LICENSE file for full copyright and licensing details.

import time
from datetime import datetime
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from dateutil.relativedelta import relativedelta
from dateutil import parser
from odoo import api, fields, models


class FolioReport(models.AbstractModel):
    _name = 'report.hotel.report_hotel_folio'

    def get_data(self, date_start, date_end):
        total_amount = 0.0
        data_folio = []
        folio_obj = self.env['hotel.folio']
        act_domain = [('checkin_date', '>=', date_start),
                      ('checkout_date', '<=', date_end)]
        tids = folio_obj.search(act_domain)
        for data in tids:
            data_folio.append({
                'name': data.name,
                'partner': data.partner_id.name,
                'checkin': parser.parse(data.checkin_date).
                    strftime(DEFAULT_SERVER_DATETIME_FORMAT),
                'checkout': parser.parse(data.checkout_date).
                    strftime(DEFAULT_SERVER_DATETIME_FORMAT),
                'amount': data.amount_total
            })
            total_amount += data.amount_total
        data_folio.append({'total_amount': total_amount})
        return data_folio

    @api.model
    def get_report_values(self, docids, data):
        self.model = self.env.context.get('active_model')
        if data is None:
            data = {}
        if not docids:
            docids = data['form'].get('docids')
        folio_profile = self.env['hotel.folio'].browse(docids)
        date_start = data['form'].get('date_start', fields.Date.today())
        date_end = data['form'].get(
            'date_end', str(datetime.now() + relativedelta(
                months=+1, day=1, days=-1))[:10])
        return {
            'doc_ids': docids,
            'doc_model': self.model,
            'data': data['form'],
            'docs': folio_profile,
            'time': time,
            'folio_data': self.get_data(date_start, date_end)
        }

{'fraction_non_alphanumeric': 0.11256233673711707, 'fraction_numerical': 0.0033246259795772976, 'mean_word_length': 2.054387237128354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7292399', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1204, 'n_words': 243}