<commit_before>from cocos.director import director
from cocos.layer import Layer, ColorLayer
from cocos.scene import Scene


from cocos.actions import ActionSprite

import pyglet

__pause_scene_generator__ = None

def get_pause_scene():
    return __pause_scene_generator__()
    
def set_pause_scene_generator(generator):
    global __pause_scene_generator__
    __pause_scene_generator__ = generator
    
def default_pause_scene():
    return PauseScene(
        director.scene, ColorLayer(0.1,0.1,0.1,0.8), PauseLayer()
        )
set_pause_scene_generator( default_pause_scene )

class PauseScene(Scene):
    def __init__(self, background_scene, *layers):
        super(PauseScene, self).__init__(*layers)
        self.bg = background_scene
        
    def on_draw(self):
        self.bg.on_draw()
        super(PauseScene, self).on_draw()
        
class PauseLayer(Layer):
    def __init__(self):
        super(PauseLayer, self).__init__()
        
        x,y = director.get_window_size()
        
        ft = pyglet.font.load('Arial', 36)
        self.text = pyglet.font.Text(ft, 
            'PAUSED', halign=pyglet.font.Text.CENTER)
        self.text.x = x/2
        self.text.y = y/2
        
    def on_draw(self):
        self.text.draw()<commit_msg>you cant pause a pause!!<commit_after>from cocos.director import director
from cocos.layer import Layer, ColorLayer
from cocos.scene import Scene


from cocos.actions import ActionSprite

import pyglet

__pause_scene_generator__ = None

def get_pause_scene():
    return __pause_scene_generator__()
    
def set_pause_scene_generator(generator):
    global __pause_scene_generator__
    __pause_scene_generator__ = generator
    
def default_pause_scene():
    return PauseScene(
        director.scene, ColorLayer(0.1,0.1,0.1,0.8), PauseLayer()
        )
set_pause_scene_generator( default_pause_scene )

class PauseScene(Scene):
    def __init__(self, background_scene, *layers):
        super(PauseScene, self).__init__(*layers)
        self.bg = background_scene
        
    def on_draw(self):
        self.bg.on_draw()
        super(PauseScene, self).on_draw()
        
class PauseLayer(Layer):
    def __init__(self):
        super(PauseLayer, self).__init__()
        
        x,y = director.get_window_size()
        
        ft = pyglet.font.load('Arial', 36)
        self.text = pyglet.font.Text(ft, 
            'PAUSED', halign=pyglet.font.Text.CENTER)
        self.text.x = x/2
        self.text.y = y/2
        
    def on_draw(self):
        self.text.draw()
        
    def on_key_press(self, k, m):
        if k == pyglet.window.key.P and m == pyglet.window.key.MOD_ACCEL:
            return True
            
{'fraction_non_alphanumeric': 0.09884801189149016, 'fraction_numerical': 0.008918617614269788, 'mean_word_length': 2.702888583218707, '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': '4892095', 'n_tokens_mistral': 890, 'n_tokens_neox': 876, 'n_words': 169}