<commit_before>try:
    import _path
except NameError:
    pass
import spyral
import sys

SIZE = (640, 480)
BG_COLOR = (0, 0, 0)

class Game(spyral.Scene):
    """
    A Scene represents a distinct state of your game. They could be menus,
    different subgames, or any other things which are mostly distinct.
    
    A Scene should define two methods, update and render.
    """
    def __init__(self):
        """
        The __init__ message for a scene should set up the camera(s) for the
        scene, and setup groups and other structures which are needed for the
        scene.
        """
        spyral.Scene.__init__(self)
        # We cannot draw directly to the root camera, so we always make a child
        # camera for our scene with our requested virtual resolution. In this
        # case we'll use the same as the window size, but this doesn't have to be
        # the case
        self.camera = self.parent_camera.make_child(SIZE)
        self.group = spyral.Group(self.camera)
        self.initialized = False
        
    def on_enter(self):
        # Some things you may wish to do every time you enter the scene
        if self.initialized:
            return
        self.initialized = True
        # Other things you may want to do only once
        bg = spyral.Image(size=SIZE)
        bg.fill(BG_COLOR)
        self.camera.set_background(bg)
        # More setup here
        name_entry = spyral.TextInputWidget('is so awesome', style=spyral.FormStyle())
        name_entry.pos = (30,30)
        self.manager = spyral.event.EventManager()
        form = spyral.form.Form('Forms', 
                                self.manager)
        form.add_widget("name_entry",
                        name_entry)
        form.focus()
        self.group.add(form)
        self.manager.register_listener(form, ['KEYDOWN', 'KEYUP', 'MOUSEMOTION','MOUSEBUTTONUP', 'MOUSEBUTTONDOWN'])
                
    def render(self):
        """
        The render function should call .draw() on the scene's group(s).
        Unless your game logic should be bound by framerate,
        logic should go elsewhere.
        """
        self.group.draw()
        
    def update(self, dt):
        """
        The update function should contain or call out to all the logic.
        Here is where group.update() should be called for the groups, where
        event handling should be taken care of, etc.
        """
        events= self.event_handler.get()
        self.manager.send_events(events)
        for event in events:
            if event['type'] == 'QUIT':
                spyral.quit()
                sys.exit()<commit_msg>Add a second field to test with.<commit_after>try:
    import _path
except NameError:
    pass
import spyral
import sys

SIZE = (640, 480)
BG_COLOR = (0, 0, 0)

class Game(spyral.Scene):
    """
    A Scene represents a distinct state of your game. They could be menus,
    different subgames, or any other things which are mostly distinct.
    
    A Scene should define two methods, update and render.
    """
    def __init__(self):
        """
        The __init__ message for a scene should set up the camera(s) for the
        scene, and setup groups and other structures which are needed for the
        scene.
        """
        spyral.Scene.__init__(self)
        # We cannot draw directly to the root camera, so we always make a child
        # camera for our scene with our requested virtual resolution. In this
        # case we'll use the same as the window size, but this doesn't have to be
        # the case
        self.camera = self.parent_camera.make_child(SIZE)
        self.group = spyral.Group(self.camera)
        self.initialized = False
        
    def on_enter(self):
        # Some things you may wish to do every time you enter the scene
        if self.initialized:
            return
        self.initialized = True
        # Other things you may want to do only once
        bg = spyral.Image(size=SIZE)
        bg.fill(BG_COLOR)
        self.camera.set_background(bg)
        # More setup here
        name_entry = spyral.TextInputWidget('is so awesome', style=spyral.FormStyle())
        name_entry.pos = (30,30)
        email_entry = spyral.TextInputWidget('<EMAIL>', style=spyral.FormStyle())
        email_entry.pos = (30, 60)
        self.manager = spyral.event.EventManager()
        form = spyral.form.Form('Forms', 
                                self.manager)
        form.add_widget("name_entry",
                        name_entry)
        form.add_widget("email_entry",
                        email_entry)
        form.focus()
        self.group.add(form)
        self.manager.register_listener(form, ['KEYDOWN', 'KEYUP', 'MOUSEMOTION','MOUSEBUTTONUP', 'MOUSEBUTTONDOWN'])
                
    def render(self):
        """
        The render function should call .draw() on the scene's group(s).
        Unless your game logic should be bound by framerate,
        logic should go elsewhere.
        """
        self.group.draw()
        
    def update(self, dt):
        """
        The update function should contain or call out to all the logic.
        Here is where group.update() should be called for the groups, where
        event handling should be taken care of, etc.
        """
        events= self.event_handler.get()
        self.manager.send_events(events)
        for event in events:
            if event['type'] == 'QUIT':
                spyral.quit()
                sys.exit()
{'fraction_non_alphanumeric': 0.085187887632251, 'fraction_numerical': 0.005472455308281649, 'mean_word_length': 2.009330406147091, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3552633', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1477, 'n_words': 529}