<commit_before>"""
This module provides all functions necessary for displaying the GUI
control window
"""
import pygame

# Color constants
BLACK   =   (   0,   0,   0)
WHITE   =   ( 255, 255, 255)
GRAY    =   ( 128, 128, 128)
LI_GRAY =   ( 204, 204, 224)
DA_GRAY =   (  77,  77,  77)
BLUE    =   (   0,   0, 255)
GREEN   =   (   0, 255,   0)
RED     =   ( 255,   0,   0)
YELLOW  =   ( 200, 200,   0)

# Drawing constants
FONT_SIZE = 20
LINE_HEIGHT = 15

# Progress bar constants
PROGRESSBAR_WIDTH = 300
PROGRESSBAR_HEIGHT = 30

# This is a simple class that will help us print to the screen
# It has nothing to do with the joysticks, just outputting the
# information.
class TextPrint:
    """
    The main control window
    """
    def __init__(self):
        self.reset()
        self.font = pygame.font.Font(None, FONT_SIZE)

    def print(self, screen, textString, color=BLACK, bg_color=None):
        textBitmap = self.font.render(textString, True, color, bg_color)
        screen.blit(textBitmap, [self.x, self.y])

    def printLine(self, screen, textString, color=BLACK, bg_color=None):
        textBitmap = self.font.render(textString, True, color, bg_color)
        screen.blit(textBitmap, [self.x, self.y])
        self.y += self.line_height

    def printEmptyLine(self, screen):
        self.y += self.line_height

    def drawProgressBar(self, screen, progress, color=BLACK):
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, PROGRESSBAR_WIDTH,PROGRESSBAR_HEIGHT), 1)
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, PROGRESSBAR_WIDTH*progress,PROGRESSBAR_HEIGHT))
        self.y += PROGRESSBAR_HEIGHT

    def drawPositiveNegativeProgressBar(self, screen, progress, color=BLACK):
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, PROGRESSBAR_WIDTH, PROGRESSBAR_HEIGHT), 1)
        pygame.draw.rect(screen, color, pygame.Rect(self.x + PROGRESSBAR_WIDTH/2, self.y, PROGRESSBAR_WIDTH/2*progress, PROGRESSBAR_HEIGHT))
        self.y += PROGRESSBAR_HEIGHT

    def reset(self):
        self.x = 10
        self.y = 10
        self.line_height = 15

    def indent(self):
        self.x += 10
<commit_msg>Start working on BooleanBox<commit_after>"""
This module provides all functions necessary for displaying the GUI
control window
"""
import pygame

# Color constants
BLACK   =   (   0,   0,   0)
WHITE   =   ( 255, 255, 255)
GRAY    =   ( 128, 128, 128)
LI_GRAY =   ( 204, 204, 224)
DA_GRAY =   (  77,  77,  77)
BLUE    =   (   0,   0, 255)
GREEN   =   (   0, 255,   0)
RED     =   ( 255,   0,   0)
YELLOW  =   ( 200, 200,   0)

# Drawing constants
FONT_SIZE = 20
LINE_HEIGHT = 15

# Progress bar constants
PROGRESSBAR_WIDTH = 300
PROGRESSBAR_HEIGHT = 30

# Boolean box constants
BOOL_BOX_WIDTH = 100
BOOL_BOX_HEIGHT = 30

# This is a simple class that will help us print to the screen
# It has nothing to do with the joysticks, just outputting the
# information.
class TextPrint:
    """
    The main control window
    """
    def __init__(self):
        self.reset()
        self.font = pygame.font.Font(None, FONT_SIZE)

    def print(self, screen, textString, color=BLACK, bg_color=None):
        textBitmap = self.font.render(textString, True, color, bg_color)
        screen.blit(textBitmap, [self.x, self.y])

    def printLine(self, screen, textString, color=BLACK, bg_color=None):
        textBitmap = self.font.render(textString, True, color, bg_color)
        screen.blit(textBitmap, [self.x, self.y])
        self.y += self.line_height

    def printEmptyLine(self, screen):
        self.y += self.line_height

    def drawProgressBar(self, screen, progress, color=BLACK):
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, PROGRESSBAR_WIDTH,PROGRESSBAR_HEIGHT), 1)
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, PROGRESSBAR_WIDTH*progress,PROGRESSBAR_HEIGHT))
        self.y += PROGRESSBAR_HEIGHT

    def drawPositiveNegativeProgressBar(self, screen, progress, color=BLACK):
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, PROGRESSBAR_WIDTH, PROGRESSBAR_HEIGHT), 1)
        pygame.draw.rect(screen, color, pygame.Rect(self.x + PROGRESSBAR_WIDTH/2, self.y, PROGRESSBAR_WIDTH/2*progress, PROGRESSBAR_HEIGHT))
        self.y += PROGRESSBAR_HEIGHT

    def drawBooleanBox(self, screen, bg_color=WHITE, fg_color=BLACK):
        pygame.draw.rect(screen, color, pygame.Rect(self.x, self.y, BOOL_BOX_WIDTH, BOOL_BOX_HEIGHT), 1)

    def reset(self):
        self.x = 10
        self.y = 10
        self.line_height = 15

    def indent(self):
        self.x += 10

{'fraction_non_alphanumeric': 0.11355231672830107, 'fraction_numerical': 0.03567544050467696, 'mean_word_length': 3.116383169203223, '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': '1836609', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1596, 'n_words': 400}