<commit_before>class Button:
	def __init__(self, text, url = '#', id = None, image = None, type = 'link'):
		self.text = text
		self.url = url
		self.id = id
		self.image = image
		self.type = type

		self.clazz = 'fancy'

	def __str__(self):
		body = self.text
		if self.image:
			body = "<img src=\"/static/images/%s\">&nbsp;%s" % (self.image, body)

		id = "id=\"%s\" " % self.id if self.id else ''

		if self.type == 'link':
			return "<a %shref=\"%s\" class=\"%s\">%s</a>" % (id, self.url, self.clazz, body)
		if self.type == 'button':
			if self.url == '#':
				return "<button %sclass=\"%s\">%s</button>" % (id, self.clazz, body)
			else:
				return "<button %sclass=\"%s\" onClick=\"document.location='%s'; return false;\">%s</button>" % (id, self.clazz, self.url, body)
		if self.type == 'submit':
			return "<button %sclass=\"%s\" onClick=\"$('form').submit();\">%s</button>" % (id, self.clazz, body)
		raise ValueError, "Unknown type '%s'" % self.type

	# MODIFIERS

	def mini(self):
		self.clazz += ' mini'
		return self

	def positive(self):
		self.clazz += ' positive'
		return self

	def negative(self):
		self.clazz += ' negative'
		return self

	def selected(self):
		self.clazz += ' selected'
		return self

	def post(self):
		self.type = 'submit'
		return self
<commit_msg>Submit the current form, not just the first one on the page<commit_after>class Button:
	def __init__(self, text, url = '#', id = None, image = None, type = 'link'):
		self.text = text
		self.url = url
		self.id = id
		self.image = image
		self.type = type

		self.clazz = 'fancy'

	def __str__(self):
		body = self.text
		if self.image:
			body = "<img src=\"/static/images/%s\">&nbsp;%s" % (self.image, body)

		id = "id=\"%s\" " % self.id if self.id else ''

		if self.type == 'link':
			return "<a %shref=\"%s\" class=\"%s\">%s</a>" % (id, self.url, self.clazz, body)
		if self.type == 'button':
			if self.url == '#':
				return "<button %sclass=\"%s\">%s</button>" % (id, self.clazz, body)
			else:
				return "<button %sclass=\"%s\" onClick=\"document.location='%s'; return false;\">%s</button>" % (id, self.clazz, self.url, body)
		if self.type == 'submit':
			return "<button %sclass=\"%s\" onClick=\"this.form.submit();\">%s</button>" % (id, self.clazz, body)
		raise ValueError, "Unknown type '%s'" % self.type

	# MODIFIERS

	def mini(self):
		self.clazz += ' mini'
		return self

	def positive(self):
		self.clazz += ' positive'
		return self

	def negative(self):
		self.clazz += ' negative'
		return self

	def selected(self):
		self.clazz += ' selected'
		return self

	def post(self):
		self.type = 'submit'
		return self

{'fraction_non_alphanumeric': 0.20570342205323194, 'fraction_numerical': 0.0, 'mean_word_length': 3.292006525285481, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3965943', 'n_tokens_mistral': 1055, 'n_tokens_neox': 966, 'n_words': 253}