<commit_before>import sys
import draw
from timer import Timer
from ctypes import *

try:
	from sdl2 import *
	import sdl2.ext as sdl2ext
except ImportError:
	import traceback
	traceback.print_exc()
	sys.exit(1)

white = sdl2ext.Color(255, 255, 255)
black = sdl2ext.Color(0, 0, 0)

def draw_pixels(renderer, xpix, ypix, grid):
	renderer.clear()
	for line in grid:
		renderer.draw_line(line, white)
	renderer.present()

def run():
	sdl2ext.init()
	draw.pixels(500, 500)
	window = sdl2ext.Window("Pixel Access", size=(draw.xpix, draw.ypix))
	window.show()
	renderer = sdl2ext.Renderer(window)
	running = True
	mat = []
	while running:
		events = sdl2ext.get_events()
		for event in events:
			if event.type == SDL_QUIT:
				running = False
				break
			if event.type == SDL_MOUSEBUTTONDOWN:
				
				x = c_int(0)
				y = c_int(0)
				print(SDL_GetMouseState(x,y))
				print(x,y)
				x = x.value
				y = y.value
				x = float(x)
				y = float(y)
				print(x, y)
				mat = mat + draw.box_t(0.25,0.25,0.25,0,0,0,float((x-250)/125),float((250-y)/125),0)
			
                        #############################
			#####                   #####
			##### KEY PRESS TO QUIT #####
			#####                   #####
			#############################
			if event.type == SDL_KEYDOWN:
				running = False
		with Timer() as t:
			draw.setFrames(1,100)
			draw.screen(-2, 2, -2, 2)
			draw.pixels(500,500)
			draw.vary("turn", 0, 360, 1, 100)
			draw.trans_matrix = draw.rotate_y("turn", draw.trans_matrix)
			draw.trans_matrix = draw.move(0, -.05, 0, draw.trans_matrix)<commit_msg>mouse, but weird effect, minor keypress fix<commit_after>import sys
import draw
from timer import Timer
from ctypes import *

try:
	from sdl2 import *
	import sdl2.ext as sdl2ext
except ImportError:
	import traceback
	traceback.print_exc()
	sys.exit(1)

white = sdl2ext.Color(255, 255, 255)
black = sdl2ext.Color(0, 0, 0)

def draw_pixels(renderer, xpix, ypix, grid):
	renderer.clear()
	for line in grid:
		renderer.draw_line(line, white)
	renderer.present()

def run():
	sdl2ext.init()
	draw.pixels(500, 500)
	window = sdl2ext.Window("Pixel Access", size=(draw.xpix, draw.ypix))
	window.show()
	renderer = sdl2ext.Renderer(window)
	running = True
	mat = []
	while running:
		events = sdl2ext.get_events()
		for event in events:
			if event.type == SDL_QUIT:
				running = False
				break
			if event.type == SDL_MOUSEBUTTONDOWN:
				
				x = c_int(0)
				y = c_int(0)
				print(SDL_GetMouseState(x,y))
				print(x,y)
				x = x.value
				y = y.value
				x = float(x)
				y = float(y)
				print(x, y)
				mat = mat + draw.box_t(0.25,0.25,0.25,0,0,0,float((x-250)/125),float((250-y)/125),0)
			
                        #############################
			#####                   #####
			##### PRESS ESC TO QUIT #####
			#####                   #####
			#############################
			if event.type == SDL_KEYDOWN:
				if event.key.keysym.sym == SDLK_ESCAPE:
					running = False
		with Timer() as t:
			draw.setFrames(1,100)
			draw.screen(-2, 2, -2, 2)
			draw.pixels(500,500)
			draw.vary("turn", 0, 360, 1, 100)
			draw.trans_matrix = draw.rotate_y("turn", draw.trans_matrix)
			draw.trans_matrix = draw.move(0, -.05, 0, draw.trans_matrix)
{'fraction_non_alphanumeric': 0.18221528861154446, 'fraction_numerical': 0.05054602184087364, 'mean_word_length': 2.982608695652174, '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': '7612983', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1205, 'n_words': 268}