<commit_before>import pygame
from pygame.locals import *

#EXPORT
class Application(object):
    def __init__(self,res=(640,480)):
        pygame.init()
        self.screen=pygame.display.set_mode(res, DOUBLEBUF)
        self.clock = pygame.time.Clock()
        self.fps=30

    def calc_dt(self):
        return 0.001*self.clock.tick(self.fps)        
        
    def flip(self):
        pygame.display.flip()

    def clear(self,color=(192,128,255)):
        self.screen.fill(color)
        
    def onKey(self,key):
        pass

    def handleEvents(self):
        for event in pygame.event.get():
            if not hasattr(event, 'key'): continue
            if event.key == K_ESCAPE:
                return False
            else:
                if event.type==2:
                    self.onKey(event.key)
        return True
        
    def loop(self,dt):
        pass
        
    def run(self):
        while self.handleEvents():
            self.loop(self.calc_dt())
            self.flip()<commit_msg>Added mouse click handling<commit_after>import pygame
from pygame.locals import *

#EXPORT
class Application(object):
    def __init__(self,res=(640,480)):
        pygame.init()
        self.screen=pygame.display.set_mode(res, DOUBLEBUF)
        self.clock = pygame.time.Clock()
        self.fps=30

    def calc_dt(self):
        return 0.001*self.clock.tick(self.fps)        
        
    def flip(self):
        pygame.display.flip()

    def clear(self,color=(192,128,255)):
        self.screen.fill(color)
        
    def onKey(self,key):
        pass
    
    def onClick(self,pos):
        pass

    def handleEvents(self):
        for event in pygame.event.get():
            if hasattr(event, 'key'):
                if event.key == K_ESCAPE:
                    return False
                else:
                    if event.type==2:
                        self.onKey(event.key)
            elif event.type==pygame.MOUSEBUTTONDOWN:
                self.onClick(event.pos)
            #elif hasattr(event,)
        return True
        
    def loop(self,dt):
        pass
        
    def run(self):
        while self.handleEvents():
            self.loop(self.calc_dt())
            self.flip()
{'fraction_non_alphanumeric': 0.11196043165467626, 'fraction_numerical': 0.019784172661870502, 'mean_word_length': 1.6331360946745561, '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': '5724126', 'n_tokens_mistral': 713, 'n_tokens_neox': 664, 'n_words': 128}