<commit_before>''' Module for Karma Level Provider Class '''
import operator
from KarmaPointsCalculator import calculate_karma_item, calculate_rounded_observations

class KarmaLevelProvider:
    ''' Karma Level Provider, has the methods to calculate the karma
        levels and to classify user for its points '''

    def __init__(self, max_level, points_per_observation):
        self.karma_data = self.__populate_points([], 1, 0, max_level)
        self.points_per_observation = points_per_observation

    def __populate_points(self, karma_list, level, total_points, max_level):
        ''' Instantiates the points array '''
        karma_item = calculate_karma_item(level, total_points, self.points_per_observation)
        karma_list.append(karma_item)
        next_total_points = total_points + karma_item['points_to_next']
        if level < max_level:
            return self.__populate_points(karma_list, level + 1, next_total_points, max_level)
        else:
            return karma_list

    def get_level_for_points(self, user_points):
        next_level = self.__get_next_level(user_points)<commit_msg>[FIX] test before commit :D<commit_after>''' Module for Karma Level Provider Class '''
import operator
from KarmaPointsCalculator import calculate_karma_item, calculate_rounded_observations

class KarmaLevelProvider:
    ''' Karma Level Provider, has the methods to calculate the karma
        levels and to classify user for its points '''

    def __init__(self, max_level, points_per_observation):
        self.points_per_observation = points_per_observation
        self.karma_data = self.__populate_points([], 1, 0, max_level)

    def __populate_points(self, karma_list, level, total_points, max_level):
        ''' Instantiates the points array '''
        karma_item = calculate_karma_item(level, total_points, self.points_per_observation)
        karma_list.append(karma_item)
        next_total_points = total_points + karma_item['points_to_next']
        if level < max_level:
            return self.__populate_points(karma_list, level + 1, next_total_points, max_level)
        else:
            return karma_list

    def get_level_for_points(self, user_points):
        next_level = self.__get_next_level(user_points)
{'fraction_non_alphanumeric': 0.07333333333333333, 'fraction_numerical': 0.0026666666666666666, 'mean_word_length': 3.991130820399113, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2392680', 'n_tokens_mistral': 676, 'n_tokens_neox': 649, 'n_words': 163}