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

import os, itertools, glob

from openfisca_core.taxbenefitsystems import TaxBenefitSystem

from . import entities
from . import decompositions, scenarios
from .model import datatrees
from .model.prelevements_obligatoires.prelevements_sociaux.cotisations_sociales import preprocessing
from .conf.cache_blacklist import cache_blacklist as conf_cache_blacklist


COUNTRY_DIR = os.path.dirname(os.path.abspath(__file__))
EXTENSIONS_PATH = os.path.join(COUNTRY_DIR, 'extensions')
EXTENSIONS_DIRECTORIES = glob.glob(os.path.join(EXTENSIONS_PATH, '*/'))

class FranceTaxBenefitSystem(TaxBenefitSystem):
    """French tax benefit system"""
    CURRENCY = u"€"
    DATA_SOURCES_DIR = os.path.join(COUNTRY_DIR, 'data', 'sources')
    DECOMP_DIR = os.path.dirname(os.path.abspath(decompositions.__file__))
    DEFAULT_DECOMP_FILE = decompositions.DEFAULT_DECOMP_FILE
    preprocess_legislation = staticmethod(preprocessing.preprocess_legislation)
    columns_name_tree_by_entity = datatrees.columns_name_tree_by_entity

    REFORMS_DIR = os.path.join(COUNTRY_DIR, 'reformes')
    REV_TYP = None  # utils.REV_TYP  # Not defined for France
    REVENUES_CATEGORIES = {
    'brut': ['salaire_brut', 'chomage_brut', 'retraite_brute', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_brut', 'fon'],
    'imposable': ['salaire_imposable', 'chomage_imposable', 'retraite_imposable', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_brut', 'fon', 'cotsoc_cap'],
    'net': ['salaire_net', 'chomage_net', 'retraite_nette', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_net', 'fon'],
    'superbrut': ['salaire_super_brut', 'chomage_brut', 'retraite_brute', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_brut', 'fon'],
    }

    def __init__(self):
        TaxBenefitSystem.__init__(self, entities.entities)
        self.Scenario = scenarios.Scenario

        param_files = [
            '__root__.xml',
            'al.xml',
            'bouclier_fiscal.xml',
            'bourses_education.xml',
            'cmu.xml',
            'cotsoc.xml',
            'crds.xml',
            'fonc.xml',
            'forfait_social.xml',
            'impot_revenu.xml',
            'isf.xml',
            'minim.xml',
            'prelevements_sociaux.xml',
            'prestations.xml',
            'taxation_capital.xml',
            'tns.xml'
        ]

        for param_file in param_files:
            param_path = os.path.join(COUNTRY_DIR, 'parameters', param_file)
            self.add_legislation_params(param_path)

        self.add_variables_from_directory(os.path.join(COUNTRY_DIR, 'model'))
        self.cache_blacklist = conf_cache_blacklist
        for extension_dir in EXTENSIONS_DIRECTORIES:
            self.load_extension(extension_dir)


    def prefill_cache(self):
        # Compute one "zone APL" variable, to pre-load CSV of "code INSEE commune" to "Zone APL".
        from .model.prestations import aides_logement
        aides_logement.preload_zone_apl()
        from .model.prelevements_obligatoires.prelevements_sociaux.contributions_sociales import versement_transport
        versement_transport.preload_taux_versement_transport()<commit_msg>Remove mention of removed XML files<commit_after># -*- coding: utf-8 -*-

import os, itertools, glob

from openfisca_core.taxbenefitsystems import TaxBenefitSystem

from . import entities
from . import decompositions, scenarios
from .model import datatrees
from .model.prelevements_obligatoires.prelevements_sociaux.cotisations_sociales import preprocessing
from .conf.cache_blacklist import cache_blacklist as conf_cache_blacklist


COUNTRY_DIR = os.path.dirname(os.path.abspath(__file__))
EXTENSIONS_PATH = os.path.join(COUNTRY_DIR, 'extensions')
EXTENSIONS_DIRECTORIES = glob.glob(os.path.join(EXTENSIONS_PATH, '*/'))

class FranceTaxBenefitSystem(TaxBenefitSystem):
    """French tax benefit system"""
    CURRENCY = u"€"
    DATA_SOURCES_DIR = os.path.join(COUNTRY_DIR, 'data', 'sources')
    DECOMP_DIR = os.path.dirname(os.path.abspath(decompositions.__file__))
    DEFAULT_DECOMP_FILE = decompositions.DEFAULT_DECOMP_FILE
    preprocess_legislation = staticmethod(preprocessing.preprocess_legislation)
    columns_name_tree_by_entity = datatrees.columns_name_tree_by_entity

    REFORMS_DIR = os.path.join(COUNTRY_DIR, 'reformes')
    REV_TYP = None  # utils.REV_TYP  # Not defined for France
    REVENUES_CATEGORIES = {
    'brut': ['salaire_brut', 'chomage_brut', 'retraite_brute', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_brut', 'fon'],
    'imposable': ['salaire_imposable', 'chomage_imposable', 'retraite_imposable', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_brut', 'fon', 'cotsoc_cap'],
    'net': ['salaire_net', 'chomage_net', 'retraite_nette', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_net', 'fon'],
    'superbrut': ['salaire_super_brut', 'chomage_brut', 'retraite_brute', 'pensions_alimentaires_percues', 'pensions_alimentaires_versees', 'rev_cap_brut', 'fon'],
    }

    def __init__(self):
        TaxBenefitSystem.__init__(self, entities.entities)
        self.Scenario = scenarios.Scenario

        param_files = [
            '__root__.xml',
            'bouclier_fiscal.xml',
            'bourses_education.xml',
            'cmu.xml',
            'cotsoc.xml',
            'crds.xml',
            'fonc.xml',
            'forfait_social.xml',
            'impot_revenu.xml',
            'prelevements_sociaux.xml',
            'prestations.xml',
            'taxation_capital.xml',
            'tns.xml'
        ]

        for param_file in param_files:
            param_path = os.path.join(COUNTRY_DIR, 'parameters', param_file)
            self.add_legislation_params(param_path)

        self.add_variables_from_directory(os.path.join(COUNTRY_DIR, 'model'))
        self.cache_blacklist = conf_cache_blacklist
        for extension_dir in EXTENSIONS_DIRECTORIES:
            self.load_extension(extension_dir)


    def prefill_cache(self):
        # Compute one "zone APL" variable, to pre-load CSV of "code INSEE commune" to "Zone APL".
        from .model.prestations import aides_logement
        aides_logement.preload_zone_apl()
        from .model.prelevements_obligatoires.prelevements_sociaux.contributions_sociales import versement_transport
        versement_transport.preload_taux_versement_transport()
{'fraction_non_alphanumeric': 0.10523095747935149, 'fraction_numerical': 0.0003059039461609055, 'mean_word_length': 3.8725782414307006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 29}, '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': '3389836', 'n_tokens_mistral': 2288, 'n_tokens_neox': 2223, 'n_words': 343}