<commit_before>import os
import pygame
import time
import datetime

os.putenv('SDL_FBDEV', '/dev/fb1') 
os.putenv('SDL_VIDEODRIVER', 'fbcon')

pygame.display.init()
pygame.font.init()
pygame.mouse.set_visible(False)
    
size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
screen = pygame.display.set_mode(size, pygame.FULLSCREEN)
time_font = pygame.font.SysFont("DejaVu Sans", 64)
date_font = pygame.font.SysFont("DejaVu Sans", 32)

screen.fill((0, 0, 0))        
now = datetime.datetime.now()
time_text = time_font.render(now.strftime("%H:%M:%S"), True, (128, 128, 128))
date_text = date_font.render(now.strftime("%d %B %Y"), True, (128, 128, 128))
screen.blit(time_text, (160 - time_text.get_width() // 2, 120 - time_text.get_height() // 2))
screen.blit(date_text, (0, 0)) 

pygame.display.update()

time.sleep(5)
<commit_msg>Refactored to fit the seven segment methods<commit_after>import os
import pygame
import time
import datetime

class Display():

    def __init__(self):
        os.putenv('SDL_FBDEV', '/dev/fb1')
        os.putenv('SDL_VIDEODRIVER', 'fbcon')

        pygame.display.init()
        pygame.font.init()
        pygame.mouse.set_visible(False)

        size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
        self.screen = pygame.display.set_mode(size, pygame.FULLSCREEN)
        self.time_font = pygame.font.SysFont("DejaVu Sans", 64)
        self.font_color = (128, 128, 128)

        self.hour = 0
        self.minute = 0
        self.second = 0
        self.colon = ":"
        self.evening = "AM"

    def setBrightness(self, level):
        self.font_color = (17 * level, 17 * level, 17 * level)

    def setColon(self, state=True):
        self.colon = ":" if state else " "

    def setEvening(self, state=True):
        self.evening = "PM" if state else "AM"

    def setMinutes(self, minutes):
        self.minute = minutes

    def setHours(self, hours):
        self.hour = hours

    def _update(self):
        screen.fill((0, 0, 0))
        time_text = time_font.render("%d%s%d %s" % (self.hour, self.colon, self.minute, self.evening), True, self.font_color)
        screen.blit(time_text, (160 - time_text.get_width() // 2, 120 - time_text.get_height() // 2))
        pygame.display.update()
{'fraction_non_alphanumeric': 0.1527655838454785, 'fraction_numerical': 0.03028972783143108, 'mean_word_length': 3.2047970479704797, 'pattern_counts': {'":': 2, '<': 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': '5860304', 'n_tokens_mistral': 885, 'n_tokens_neox': 809, 'n_words': 166}