<commit_before>import random

class IconLayout:
	def __init__(self, width, height):
		self._icons = []
		self._width = width
		self._height = height

	def add_icon(self, icon):
		self._icons.append(icon)
		self._layout_icon(icon)

	def remove_icon(self, icon):
		self._icons.remove(icon)

	def _is_valid_position(self, icon, x, y):
		icon_size = icon.props.size
		border = 20

		if not (border < x < self._width - icon_size - border and \
		        border < y < self._height - icon_size - border):
			return False
		
		return True

	def _layout_icon(self, icon):
		while True:
			x = random.random() * self._width
			y = random.random() * self._height
			if self._is_valid_position(icon, x, y):
				break

		icon.props.x = x
		icon.props.y = y<commit_msg>Use get/set_property rather than direct accessors<commit_after>import random

class IconLayout:
	def __init__(self, width, height):
		self._icons = []
		self._width = width
		self._height = height

	def add_icon(self, icon):
		self._icons.append(icon)
		self._layout_icon(icon)

	def remove_icon(self, icon):
		self._icons.remove(icon)

	def _is_valid_position(self, icon, x, y):
		icon_size = icon.get_property('size')
		border = 20

		if not (border < x < self._width - icon_size - border and \
		        border < y < self._height - icon_size - border):
			return False
		
		return True

	def _layout_icon(self, icon):
		while True:
			x = random.random() * self._width
			y = random.random() * self._height
			if self._is_valid_position(icon, x, y):
				break

		icon.set_property('x', x)
		icon.set_property('y', y)
{'fraction_non_alphanumeric': 0.11944091486658195, 'fraction_numerical': 0.0025412960609911056, 'mean_word_length': 3.326923076923077, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5691603', 'n_tokens_mistral': 610, 'n_tokens_neox': 535, 'n_words': 140}