<commit_before># coding=utf-8
from copy import deepcopy
from itertools import product
from simpleai.models import CspAssignment

"hiperarc_consistency = tomo cada var, y me fijo que para todas las restricciones todos sus valores tengan posibles valores en el resto de las variables restringidas"

MOST_CONSTRAINED_VARIABLE = 'mcv'
HIGHEST_DEGREE_VARIABLE = 'degree'
LEAST_CONSTRAINING_VALUE = 'lvc'


def backtrack(csp_problem, variable_heuristic='', value_heuristic=''):
    assignment = {}
    domains = deepcopy(csp_problem.domains)

    if variable_heuristic == MOST_CONSTRAINED_VARIABLE:
        variable_chooser = _most_constrained_variable_chooser
    elif variable_heuristic == HIGHEST_DEGREE_VARIABLE:
        variable_chooser = _highest_degree_variable_chooser
    else:
        variable_chooser = _basic_variable_chooser

    if value_heuristic == LEAST_CONSTRAINING_VALUE:
        values_sorter = _least_constraining_values_sorter
    else:
        values_sorter = _basic_values_sorter

    return _backtracking(csp_problem,
                         assignment,
                         domains,
                         variable_chooser,
                         values_sorter)
<commit_msg>Removed garbage code (notes, unused imports)<commit_after># coding=utf-8
from copy import deepcopy


MOST_CONSTRAINED_VARIABLE = 'mcv'
HIGHEST_DEGREE_VARIABLE = 'degree'
LEAST_CONSTRAINING_VALUE = 'lvc'


def backtrack(csp_problem, variable_heuristic='', value_heuristic=''):
    assignment = {}
    domains = deepcopy(csp_problem.domains)

    if variable_heuristic == MOST_CONSTRAINED_VARIABLE:
        variable_chooser = _most_constrained_variable_chooser
    elif variable_heuristic == HIGHEST_DEGREE_VARIABLE:
        variable_chooser = _highest_degree_variable_chooser
    else:
        variable_chooser = _basic_variable_chooser

    if value_heuristic == LEAST_CONSTRAINING_VALUE:
        values_sorter = _least_constraining_values_sorter
    else:
        values_sorter = _basic_values_sorter

    return _backtracking(csp_problem,
                         assignment,
                         domains,
                         variable_chooser,
                         values_sorter)

{'fraction_non_alphanumeric': 0.05368516833484986, 'fraction_numerical': 0.0009099181073703367, 'mean_word_length': 3.204588910133843, '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': '6224916', 'n_tokens_mistral': 706, 'n_tokens_neox': 659, 'n_words': 130}