<commit_before>from gi.repository import Gtk, GdkPixbuf, GLib
import cv2

class View(Gtk.Window):
	def __init__(self, title, camera, interval=200):
		Gtk.Window.__init__(self)
		self.set_title(title)
		self.cam = camera
		self.img = Gtk.Image()
		self.add(self.img)
		GLib.timeout_add(interval, self.update)

	def update(self):
		if self.cam.isReady():
			frame = cv2.cvtColor(self.cam.getFrame(), cv2.COLOR_BGR2RGB)
			self.img.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_data(frame.data, GdkPixbuf.Colorspace.RGB, False, 8, frame.shape[1], frame.shape[0], frame.strides[0], None, None))
		else:
			print('not ready')<commit_msg>Set an initial size and disallow resizing<commit_after>from gi.repository import Gtk, GdkPixbuf, GLib
import cv2

class View(Gtk.Window):
	def __init__(self, title, camera, interval=200):
		Gtk.Window.__init__(self)
		self.set_title(title)
		self.set_size_request(640, 480)
		self.set_resizable(False)
		self.cam = camera
		self.img = Gtk.Image()
		self.add(self.img)
		GLib.timeout_add(interval, self.update)

	def update(self):
		if self.cam.isReady():
			frame = cv2.cvtColor(self.cam.getFrame(), cv2.COLOR_BGR2RGB)
			self.img.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_data(frame.data, GdkPixbuf.Colorspace.RGB, False, 8, frame.shape[1], frame.shape[0], frame.strides[0], None, None))
		else:
			print('not ready')
{'fraction_non_alphanumeric': 0.14041604754829123, 'fraction_numerical': 0.020802377414561663, 'mean_word_length': 5.122727272727273, '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': '4395316', 'n_tokens_mistral': 567, 'n_tokens_neox': 517, 'n_words': 94}