<commit_before>#!/usr/bin/python
import os
import time
import pygame  # See http://www.pygame.org/docs

print("Press Escape to quit")
time.sleep(1)

from pygame.locals import *
from astro_pi import AstroPi

pygame.init()
pygame.display.set_mode((640, 480))

ap = AstroPi()
ap.clear()  # Blank the LED matrix

# 0, 0 = Top left
# 7, 7 = Bottom right
UP_PIXELS = [[0, 3], [0, 4]]
DOWN_PIXELS = [[7, 3], [7, 4]]
LEFT_PIXELS = [[3, 0], [4, 0]]
RIGHT_PIXELS = [[3, 7], [4, 7]]
CENTRE_PIXELS = [[3, 3], [3, 4], [4, 3], [4, 4]]


def set_pixels(pixels, colour):
    for p in pixels:
        ap.set_pixel_xy(p[0], p[1], colour)


def handle_event(event, colour):
    if event.key == pygame.K_DOWN:
        set_pixels(DOWN_PIXELS, colour)
    elif event.key == pygame.K_UP:
        set_pixels(UP_PIXELS, colour)
    elif event.key == pygame.K_LEFT:
        set_pixels(LEFT_PIXELS, colour)
    elif event.key == pygame.K_RIGHT:
        set_pixels(RIGHT_PIXELS, colour)
    elif event.key == pygame.K_RETURN:
        set_pixels(CENTRE_PIXELS, colour)


running = True<commit_msg>fix xy after module fix<commit_after>#!/usr/bin/python
import os
import time
import pygame  # See http://www.pygame.org/docs

print("Press Escape to quit")
time.sleep(1)

from pygame.locals import *
from astro_pi import AstroPi

pygame.init()
pygame.display.set_mode((640, 480))

ap = AstroPi()
ap.clear()  # Blank the LED matrix

# 0, 0 = Top left
# 7, 7 = Bottom right
UP_PIXELS = [[3, 0], [4, 0]]
DOWN_PIXELS = [[3, 7], [4, 7]]
LEFT_PIXELS = [[0, 3], [0, 4]]
RIGHT_PIXELS = [[7, 3], [7, 4]]
CENTRE_PIXELS = [[3, 3], [4, 3], [3, 4], [4, 4]]


def set_pixels(pixels, colour):
    for p in pixels:
        ap.set_pixel_xy(p[0], p[1], colour)


def handle_event(event, colour):
    if event.key == pygame.K_DOWN:
        set_pixels(DOWN_PIXELS, colour)
    elif event.key == pygame.K_UP:
        set_pixels(UP_PIXELS, colour)
    elif event.key == pygame.K_LEFT:
        set_pixels(LEFT_PIXELS, colour)
    elif event.key == pygame.K_RIGHT:
        set_pixels(RIGHT_PIXELS, colour)
    elif event.key == pygame.K_RETURN:
        set_pixels(CENTRE_PIXELS, colour)


running = True
{'fraction_non_alphanumeric': 0.15284249767008387, 'fraction_numerical': 0.034482758620689655, 'mean_word_length': 3.50104821802935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1976006', 'n_tokens_mistral': 944, 'n_tokens_neox': 889, 'n_words': 219}