<commit_before>class BoxPlot(object):

    def __init__(self, result_set):
        self.result_set = result_set

    def dataset(self):
        return [
            s / (self.result_set.turns * float((len(self.result_set.ranking) - 1)))
            for s in self.result_set.scores[self.result_set.ranking]]

    def xticks_locations(self):
        return range(1, len(self.result_set.ranked_names) + 2)

    def xticks_labels(self):
        return [str(n) for n in self.result_set.ranked_names]

    def title(self):
        return 'Mean score per stage game over {} rounds repeated {} times ({} strategies)'.format(
            self.result_set.turns,
            self.result_set.repetitions,
            len(self.result_set.ranking))

    def figure(self):
        import matplotlib.pyplot as plt
        figure = plt.figure()
        plt.boxplot(self.dataset())
        plt.xticks(
            self.xticks_locations(),
            self.xticks_labels(),
            rotation=90)
        plt.title(self.title())
        return figure<commit_msg>moves import statement<commit_after>import matplotlib.pyplot as plt

class BoxPlot(object):

    def __init__(self, result_set):
        self.result_set = result_set

    def dataset(self):
        return [
            s / (self.result_set.turns * float((len(self.result_set.ranking) - 1)))
            for s in self.result_set.scores[self.result_set.ranking]]

    def xticks_locations(self):
        return range(1, len(self.result_set.ranked_names) + 2)

    def xticks_labels(self):
        return [str(n) for n in self.result_set.ranked_names]

    def title(self):
        return 'Mean score per stage game over {} rounds repeated {} times ({} strategies)'.format(
            self.result_set.turns,
            self.result_set.repetitions,
            len(self.result_set.ranking))

    def figure(self):
        figure = plt.figure()
        plt.boxplot(self.dataset())
        plt.xticks(
            self.xticks_locations(),
            self.xticks_labels(),
            rotation=90)
        plt.title(self.title())
        return figure
{'fraction_non_alphanumeric': 0.11089866156787763, 'fraction_numerical': 0.004780114722753346, 'mean_word_length': 2.3117088607594938, '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': '6495884', 'n_tokens_mistral': 660, 'n_tokens_neox': 629, 'n_words': 129}