<commit_before>import sys
import pygame
import pygame.locals
import pygame.time
pygame.init()
size = width, height = 575, 575

screen = pygame.display.set_mode(size)

label_lights = False


def up_row(x_offset):
    for i in range(20):
        x = x_offset + (i % 2) * 0.5
        y = i * 0.5
        yield x, y

def down_row(x_offset):
    for i in range(20):
        x = x_offset + ((i+ 1) % 2) * 0.5
        y = 9.5 - (i * 0.5)
        yield x, y

pos_list = []

for strip_pair in range(5):
    pos_list += list(up_row(2 * strip_pair))
    pos_list += list(down_row(2 * strip_pair + 1))


positions = {i: v for i, v in enumerate(pos_list)}

def get_color(i):
    red = 255 * (i / 199.0)
    green = 0
    blue = 255 * ((199-i) / 199.0)
    c = (int(red), int(green), int(blue))
    return c

def get_screen_pos(x, y):
    # upper_left is 0,0
    # bottom left is 0, width
    scaled_x = (int)(50*x+50)
    scaled_y = (int)(width - 50 - (50*y))
    return (scaled_x, scaled_y)

myfont = pygame.font.SysFont("monospace", 15)

import struct


data = open('Resources/video.bin', 'rb')
clock = pygame.time.Clock()
while True:
    for event in pygame.event.get():
        if event.type == pygame.locals.QUIT:
            sys.exit(0)

    for k, v in positions.items():
        x, y = v
        pos = get_screen_pos(x, y)

        r = ord(data.read(1))
        g = ord(data.read(1))
        b = ord(data.read(1))
        color = (r,g,b)

        pygame.draw.circle(screen, color, pos, 10)

        if label_lights:
            label = myfont.render(str(k), 1, (255, 255, 255))
            screen.blit(label, pos)

    pygame.display.update()
    clock.tick(20)<commit_msg>Use bigger circles to model diffusion<commit_after>import sys
import pygame
import pygame.locals
import pygame.time
pygame.init()
size = width, height = 575, 575

screen = pygame.display.set_mode(size)

label_lights = False


def up_row(x_offset):
    for i in range(20):
        x = x_offset + (i % 2) * 0.5
        y = i * 0.5
        yield x, y

def down_row(x_offset):
    for i in range(20):
        x = x_offset + ((i+ 1) % 2) * 0.5
        y = 9.5 - (i * 0.5)
        yield x, y

pos_list = []

for strip_pair in range(5):
    pos_list += list(up_row(2 * strip_pair))
    pos_list += list(down_row(2 * strip_pair + 1))


positions = {i: v for i, v in enumerate(pos_list)}

def get_color(i):
    red = 255 * (i / 199.0)
    green = 0
    blue = 255 * ((199-i) / 199.0)
    c = (int(red), int(green), int(blue))
    return c

def get_screen_pos(x, y):
    # upper_left is 0,0
    # bottom left is 0, width
    scaled_x = (int)(50*x+50)
    scaled_y = (int)(width - 50 - (50*y))
    return (scaled_x, scaled_y)

myfont = pygame.font.SysFont("monospace", 15)

import struct


data = open('Resources/video.bin', 'rb')
clock = pygame.time.Clock()
while True:
    for event in pygame.event.get():
        if event.type == pygame.locals.QUIT:
            sys.exit(0)

    for k, v in positions.items():
        x, y = v
        pos = get_screen_pos(x, y)

        r = ord(data.read(1))
        g = ord(data.read(1))
        b = ord(data.read(1))
        color = (r,g,b)

        pygame.draw.circle(screen, color, pos, 17)

        if label_lights:
            label = myfont.render(str(k), 1, (255, 255, 255))
            screen.blit(label, pos)

    pygame.display.update()
    clock.tick(20)
{'fraction_non_alphanumeric': 0.14761904761904762, 'fraction_numerical': 0.04523809523809524, 'mean_word_length': 2.3080708661417324, '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': '1289210', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1278, 'n_words': 338}