<commit_before>import pygame

class KeyObj:
	pass

key = KeyObj();
key.pressed = []
key.lastPressed = []

def init():
	key.pressed = pygame.key.get_pressed()
	key.lastPressed = pygame.key.get_pressed()

def update():
	key.lastPressed = key.pressed[:]
	key.pressed = pygame.key.get_pressed()

def isPressed(_key):
	return key.pressed[_key]

def justPressed(_key):
	return key.pressed[_key] and not(key.lastPressed[_key])

def justReleased(_key):
	return not(key.pressed[_key]) and key.lastPressed[_key]<commit_msg>created proper class for key<commit_after>import pygame

class KeyObj:
	def __init__(self):
		self.pressed = pygame.key.get_pressed()
		self.lastPressed = pygame.key.get_pressed()
	def update(self):
		self.lastPressed = key.pressed[:]
		self.pressed = pygame.key.get_pressed()

	def isPressed(self, _key):
		return self.pressed[_key]

	def justPressed(self, _key):
		return self.pressed[_key] and not(self.lastPressed[_key])

	def justReleased(self, _key):
		return not(self.pressed[_key]) and self.lastPressed[_key]
{'fraction_non_alphanumeric': 0.13508260447035958, 'fraction_numerical': 0.0, 'mean_word_length': 5.4375, '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': '285818', 'n_tokens_mistral': 378, 'n_tokens_neox': 367, 'n_words': 75}