<commit_before>from department import Department
import re

class ID:
	def __init__(self, dept='', num=0, sec='', combined=''):
		if not combined:
			self.department = Department(dept)
			self.number = int(num)
		else:
			regex = "(?i)(([a-z]*)(?=/)(/)([a-z]*)|[a-z]*) *(\d*)"
			replace = "\g<1> \g<5>"
			result = re.sub(regex, replace, combined)
			sides = result.split()
			self.department = Department(sides[0])
			self.number = int(sides[1])

		self.section = sec


	def __str__(self):
		return str(self.department) + " " + str(self.number) + self.section
		# return self.section


	def __eq__(self, other):
		return (
				self.department == other.department and
				self.number == other.number #and
				# self.section == other.section
			)

	def __hash__(self):
		return hash(str(self.department) + " " + str(self.number))


if __name__ == '__main__':
	ids = [
		ID("AS/RE", 121, 'A'),
		ID(combined="AS/HI121", sec='B')
	]
	for i in ids:
		print(i)<commit_msg>Check for equality in ID's test<commit_after>from department import Department
import re

class ID:
	def __init__(self, dept='', num=0, sec='', combined=''):
		if not combined:
			self.department = Department(dept)
			self.number = int(num)
		else:
			regex = "(?i)(([a-z]*)(?=/)(/)([a-z]*)|[a-z]*) *(\d*)"
			replace = "\g<1> \g<5>"
			result = re.sub(regex, replace, combined)
			sides = result.split()
			self.department = Department(sides[0])
			self.number = int(sides[1])

		self.section = sec


	def __str__(self):
		return str(self.department) + " " + str(self.number) + self.section
		# return self.section


	def __eq__(self, other):
		return (
				self.department == other.department and
				self.number == other.number #and
				# self.section == other.section
			)

	def __hash__(self):
		return hash(str(self.department) + " " + str(self.number))


if __name__ == '__main__':
	ids = [
		ID("AS/RE", 121, 'A'),
		ID(combined="AS/HI121", sec='B'),
		ID("AS/RE", 121, 'A')
	]
	for i in ids:
		print(i)
	if ids[0] == ids[2]:
		print("success")
{'fraction_non_alphanumeric': 0.19405940594059407, 'fraction_numerical': 0.013366336633663366, 'mean_word_length': 3.572398190045249, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1123206', 'n_tokens_mistral': 884, 'n_tokens_neox': 762, 'n_words': 169}