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

from abc import ABC

from plotly import graph_objs as go


class AtomBuilder(ABC):
    def __init__(self, data=None, layout=None):
        if data is None:
            data = {}
        if layout is None:
            layout = {}
        self.data = data
        self.layout = layout


class Scatter(AtomBuilder):
    def __init__(self, x, y, mode='markers', **kwargs):
        super().__init__(data=go.Scatter(x=x, y=y, mode=mode, **kwargs))


class Line(AtomBuilder):
    def __init__(self, x, y, mode='lines', **kwargs):
        super().__init__(data=go.Scatter(x=x, y=y, mode=mode, **kwargs))


class Box(AtomBuilder):
    def __init__(self, y, **kwargs):
        super().__init__(data=go.Box(y=y, **kwargs))

    def horizontal(self):
        if 'x' in self.data:
            self.data.x, self.data.y = self.data.y, self.data.x
        else:
            self.data['x'] = self.data.y
            del self.data['y']
        self.data['orientation'] = 'h'
        return self


class Bar(AtomBuilder):
    def __init__(self, x, y, **kwargs):<commit_msg>add pie plot<commit_after># -*- coding: utf-8 -*-

from abc import ABC

from plotly import graph_objs as go


class AtomBuilder(ABC):
    def __init__(self, data=None, layout=None):
        if data is None:
            data = {}
        if layout is None:
            layout = {}
        self.data = data
        self.layout = layout


class Pie(AtomBuilder):
    def __init__(self, labels, values, **kwargs):
        super().__init__(data=go.Pie(labels=labels, values=values, **kwargs))


class Scatter(AtomBuilder):
    def __init__(self, x, y, mode='markers', **kwargs):
        super().__init__(data=go.Scatter(x=x, y=y, mode=mode, **kwargs))


class Line(AtomBuilder):
    def __init__(self, x, y, mode='lines', **kwargs):
        super().__init__(data=go.Scatter(x=x, y=y, mode=mode, **kwargs))


class Box(AtomBuilder):
    def __init__(self, y, **kwargs):
        super().__init__(data=go.Box(y=y, **kwargs))

    def horizontal(self):
        if 'x' in self.data:
            self.data.x, self.data.y = self.data.y, self.data.x
        else:
            self.data['x'] = self.data.y
            del self.data['y']
        self.data['orientation'] = 'h'
        return self


class Bar(AtomBuilder):
    def __init__(self, x, y, **kwargs):
{'fraction_non_alphanumeric': 0.15805211448099102, 'fraction_numerical': 0.0008543357539513029, 'mean_word_length': 2.5755725190839693, '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': '1638474', 'n_tokens_mistral': 800, 'n_tokens_neox': 783, 'n_words': 193}