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

from __future__ import division

from openfisca_core import columns
from openfisca_core.columns import MONTH
from openfisca_core.reforms import Reform
from openfisca_core.variables import Variable
from scipy.optimize import fsolve

from .. import entities

def calculate_net_from(salaire_de_base, simulation, period, requested_variable_names):

    # We're not wanting to calculate salaire_de_base again, but instead manually set it as an input variable
    # To avoid possible conflicts, remove its function
    simulation.holder_by_name['salaire_de_base'].formula.function = None
    simulation.get_or_new_holder('salaire_de_base').array = salaire_de_base

    # Work in isolation
    temp_simulation = simulation.clone()

    # Calculated variable holders might contain undesired cache
    # (their entity.simulation points to the original simulation above)
    for name in requested_variable_names:
        del temp_simulation.holder_by_name[name]

    # Force recomputing of salaire_net
    del temp_simulation.holder_by_name['salaire_net_a_payer']

    net = temp_simulation.calculate('salaire_net_a_payer', period)[0]

    return net
<commit_msg>Fix imports in reform<commit_after># -*- coding: utf-8 -*-

from __future__ import division

from openfisca_core import columns
from openfisca_core.reforms import Reform
from scipy.optimize import fsolve

from .. import entities
from ..model.base import *

def calculate_net_from(salaire_de_base, simulation, period, requested_variable_names):

    # We're not wanting to calculate salaire_de_base again, but instead manually set it as an input variable
    # To avoid possible conflicts, remove its function
    simulation.holder_by_name['salaire_de_base'].formula.function = None
    simulation.get_or_new_holder('salaire_de_base').array = salaire_de_base

    # Work in isolation
    temp_simulation = simulation.clone()

    # Calculated variable holders might contain undesired cache
    # (their entity.simulation points to the original simulation above)
    for name in requested_variable_names:
        del temp_simulation.holder_by_name[name]

    # Force recomputing of salaire_net
    del temp_simulation.holder_by_name['salaire_net_a_payer']

    net = temp_simulation.calculate('salaire_net_a_payer', period)[0]

    return net

{'fraction_non_alphanumeric': 0.06341045415595545, 'fraction_numerical': 0.001713796058269066, 'mean_word_length': 4.737100737100737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6601329', 'n_tokens_mistral': 706, 'n_tokens_neox': 682, 'n_words': 196}