<commit_before>import cairo
import math

from pylsner.plugin import Indicator


class Plugin(Indicator):

    def __init__(self,
                 length=100,
                 width=10,
                 orientation=0,
                 radius=100,
                 background=False,
                 **kwargs
                ):
        length = math.radians(360) * (length / 100)
        super().__init__(length, width, orientation, **kwargs)

        self.radius = radius
        self.background = background

        self._angle_start = math.radians(-90) + math.radians(self.orientation)
        self._angle_end = self._angle_start

    def redraw(self, ctx, metric_value):
        self._angle_end = self._angle_start + (metric_value * self.length)
        ctx.set_line_width(self.width)
        ctx.arc(
            self.position[0],
            self.position[1],
            self.radius,
            self._angle_start,
            self._angle_end,
        )
        ctx.stroke()
        if self.background:
            source = ctx.get_source()
            if isinstance(source, cairo.SolidPattern):
                r, g, b, a = ctx.get_source().get_rgba()
                a = a / 2
            else:<commit_msg>added position as kwarg to arc indicator<commit_after>import cairo
import math

from pylsner.plugin import Indicator


class Plugin(Indicator):

    def __init__(self,
                 length=100,
                 width=10,
                 orientation=0,
                 position=[0, 0],
                 radius=100,
                 background=False,
                 **kwargs
                ):
        length = math.radians(360) * (length / 100)
        super().__init__(length, width, orientation, position, **kwargs)

        self.radius = radius
        self.background = background

        self._angle_start = math.radians(-90) + math.radians(self.orientation)
        self._angle_end = self._angle_start

    def redraw(self, ctx, metric_value):
        self._angle_end = self._angle_start + (metric_value * self.length)
        ctx.set_line_width(self.width)
        ctx.arc(
            self.position[0],
            self.position[1],
            self.radius,
            self._angle_start,
            self._angle_end,
        )
        ctx.stroke()
        if self.background:
            source = ctx.get_source()
            if isinstance(source, cairo.SolidPattern):
                r, g, b, a = ctx.get_source().get_rgba()
                a = a / 2
            else:
{'fraction_non_alphanumeric': 0.09843937575030012, 'fraction_numerical': 0.01680672268907563, 'mean_word_length': 1.5799793601651186, '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': '2866625', 'n_tokens_mistral': 723, 'n_tokens_neox': 675, 'n_words': 142}