<commit_before>#!/usr/bin/python
# $Id:$

from graphics.text import layout, document

class Label(layout.TextLayout):
    def __init__(self, text='', font=None, color=(255, 255, 255, 255), 
                 x=0, y=0, halign='left', valign='top', batch=None,
                 state_order=0):
        if font is None:
            from pyglet import font as font_module
            font = font_module.load('', 10)
        doc = document.UnformattedDocument(text, font, color)
        super(Label, self).__init__(doc, batch, state_order)

        self._x = 0
        self._y = 0
        self._halign = halign
        self._valign = valign
        self._update()

    def _get_text(self):
        return self.document.text

    def _set_text(self, text):
        self.document.text = text

    text = property(_get_text, _set_text)

    def _get_color(self):
        return self.document.color

    def _set_color(self, color):
        self.document.color = color<commit_msg>Fix Label.<commit_after>#!/usr/bin/python
# $Id:$

from graphics.text import layout, document

class Label(layout.TextLayout):
    def __init__(self, text='', font=None, color=(255, 255, 255, 255), 
                 x=0, y=0, halign='left', valign='top', batch=None,
                 state_order=0):
        if font is None:
            from pyglet import font as font_module
            font = font_module.load('', 10)
        doc = document.UnformattedDocument(text, font, color)
        super(Label, self).__init__(doc, multiline=False, batch=batch,
                                    state_order=state_order)

        self._x = 0
        self._y = 0
        self._halign = halign
        self._valign = valign
        self._update()

    def _get_text(self):
        return self.document.text

    def _set_text(self, text):
        self.document.text = text

    text = property(_get_text, _set_text)

    def _get_color(self):
        return self.document.color

    def _set_color(self, color):
        self.document.color = color
{'fraction_non_alphanumeric': 0.11304780876494024, 'fraction_numerical': 0.018924302788844622, 'mean_word_length': 2.229903536977492, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3622096', 'n_tokens_mistral': 658, 'n_tokens_neox': 601, 'n_words': 149}