<commit_before>import reui

'''
A box is a region of a display that can be drawn to. Boxes can optionally have borders.
'''
class Box:
    '''
    width = width of box
    height = height of box
    '''
    def __init__(self, display, width, height, border_flags=0, x=0, y=0):
        self.display = display
        self.width = width
        self.height = height
        self.border_flags = border_flags
        #Temporary until I decide on how this will be implemented
        self.x = x
        self.y = y

    def draw_text(self, x, y, string):
        self.display.draw_text(x + self.x, y + self.y, string)
        
    def draw_border(self):
        if self.border_flags | reui.BORDER_TOP:
            for x in range(self.x, self.x + self.width):
                self.display.draw_pixel(x, self.y)
        if self.border_flags | reui.BORDER_BOTTOM:
            for x in range(self.x, self.x + self.width):
                self.display.draw_pixel(x, self.y + self.height)
        if self.border_flags | reui.BORDER_LEFT:
            for y in range(self.y, self.y + self.height):
                self.display.draw_pixel(self.x, y)
        if self.border_flags | reui.BORDER_RIGHT:
            for y in range(self.y, self.y + self.height):
                self.display.draw_pixel(self.x + self.width, y)
    
    def refresh(self):
        self.display.display()<commit_msg>Border drawing, test script<commit_after>import reui

'''
A box is a region of a display that can be drawn to. Boxes can optionally have borders.
'''
class Box:
    '''
    width = width of box
    height = height of box
    '''
    def __init__(self, display, width, height, border_flags=0, x=0, y=0):
        self.display = display
        self.width = width
        self.height = height
        self.border_flags = border_flags
        #Temporary until I decide on how this will be implemented
        self.x = x
        self.y = y

    def draw_text(self, x, y, string):
        self.display.draw_text(x + self.x, y + self.y, string)
        
    def draw_border(self):
        if self.border_flags & reui.BORDER_TOP:
            for x in range(self.x, self.x + self.width - 1):
                self.display.draw_pixel(x, self.y)
        if self.border_flags & reui.BORDER_BOTTOM:
            for x in range(self.x - 1, self.x + self.width - 1):
                self.display.draw_pixel(x, self.y + self.height - 1)
        if self.border_flags & reui.BORDER_LEFT:
            for y in range(self.y, self.y + self.height - 1):
                self.display.draw_pixel(self.x, y)
        if self.border_flags & reui.BORDER_RIGHT:
            for y in range(self.y, self.y + self.height - 1):
                self.display.draw_pixel(self.x + self.width - 1, y)
    
    def refresh(self):
        self.display.display()
{'fraction_non_alphanumeric': 0.10801144492131616, 'fraction_numerical': 0.004649499284692418, 'mean_word_length': 1.9850586979722518, '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': '167223', 'n_tokens_mistral': 908, 'n_tokens_neox': 888, 'n_words': 251}