<commit_before>from math import sin, cos, pi
import pg

class Window(pg.Window):
    def setup(self):
        self.wasd = pg.WASD(self, speed=5)
        self.wasd.look_at((14, 0, 0), (0, 0, 0))
        self.context = pg.Context(pg.DirectionalLightProgram())
        sphere = pg.Sphere(3, 0.4, (0, 0, 0))
        self.context.position = pg.VertexBuffer(sphere.position)
        self.context.normal = pg.VertexBuffer(sphere.normal)
    def draw(self):
        self.clear()
        self.context.camera_position = self.wasd.position
        matrix = self.wasd.get_matrix()
        matrix = matrix.perspective(65, self.aspect, 0.01, 100)
        for z in range(-2, 3):
            for x in range(-10, 11):
                y = sin(self.time * pi + x * 0.5 + z * pi) * 3
                model_matrix = pg.Matrix().translate((x, y, z * 3))
                self.context.model_matrix = model_matrix
                self.context.matrix = matrix * model_matrix
                self.context.draw(pg.GL_TRIANGLES)

if __name__ == "__main__":
    app = pg.App()
    Window()
    app.run()<commit_msg>colored balls<commit_after>from math import sin, cos, pi
import pg

RED = 0xF04326
YELLOW = 0xFAC02D
GREEN = 0x1AB243
BLUE = 0x1256D1

COLORS = [pg.hex_color(x) for x in [RED, YELLOW, GREEN, BLUE]]

class Window(pg.Window):
    def setup(self):
        self.wasd = pg.WASD(self, speed=5)
        self.wasd.look_at((14, 0, 0), (0, 0, 0))
        self.context = pg.Context(pg.DirectionalLightProgram())
        sphere = pg.Sphere(3, 0.4, (0, 0, 0))
        self.context.position = pg.VertexBuffer(sphere.position)
        self.context.normal = pg.VertexBuffer(sphere.normal)
        self.context.ambient_color = (0.4, 0.4, 0.4)
        self.context.light_color = (0.6, 0.6, 0.6)
    def draw(self):
        self.clear()
        self.context.camera_position = self.wasd.position
        matrix = self.wasd.get_matrix()
        matrix = matrix.perspective(65, self.aspect, 0.01, 100)
        for z in range(-2, 3):
            for x in range(-10, 11):
                y = sin(self.time * pi + x * 0.5 + z * pi) * 3
                model_matrix = pg.Matrix().translate((x, y, z * 3))
                self.context.model_matrix = model_matrix
                self.context.matrix = matrix * model_matrix
                self.context.object_color = COLORS[(z + x) % len(COLORS)]
                self.context.draw(pg.GL_TRIANGLES)

if __name__ == "__main__":
    app = pg.App()
    Window()
    app.run()
{'fraction_non_alphanumeric': 0.13876563130294473, 'fraction_numerical': 0.03872529245663574, 'mean_word_length': 2.1713554987212276, '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': '327863', 'n_tokens_mistral': 918, 'n_tokens_neox': 844, 'n_words': 191}