<commit_before>class Requirement:
	def __init__(self, name="", needed=0):
		self.name = name
		self.needed = needed
		self.has = 0
		self.satisfied = False
		self.checkSatisfied()

	def checkSatisfied(self):
		if self.has >= self.needed:
			self.satisfied = True
		else:
			self.satisfied = False

	def incrementHas(self):
		self.has += 1
		self.checkSatisfied()

	def decrementHas(self):
		self.has -= 1
		self.checkSatisfied()

	def __str__(self):
		if self.satisfied:
			ostream = "\u2705"
		else:
			ostream = "\u274C"

		ostream += "  " + self.name + " needs " + str(self.needed)

		if self.satisfied:
			ostream += ", and has "
		else:
			ostream += ", but has "

		ostream += str(self.has) + "."

		return ostream

	def __eq__(self, other):
		return (
			self.name == other.name and
			self.needed == other.needed and
			self.has == other.has and
			self.satisfied == other.satisfied
		)


class RequirementWithValididty(Requirement):
	def __init__(self, name="", needed=0):
		super().__init__(name, needed)
		self.valid = []

	def __eq__(self, other):
		return (
			super().__eq__(other) and
			self.valid == other.valid
		)

	def addCourse(course):
		self.valid.append(course)

	def fulfillsRequirement(course):
		return course in self.valid


class MajorRequirement(RequirementWithValididty):
	def __init__(self, name="", needed=0):
		super().__init__(name, needed)


class SpecialRequirement(RequirementWithValididty):
	def __init__(self, name="", needed=0):
		super().__init__(name, needed)


if __name__ == '__main__':
	tmp = [
		Requirement("Semester in Asia"),
		Requirement("Semester in Japan", 1),
		MajorRequirement("Major Req", 1),
		SpecialRequirement("Special Req")
	]
	for i in tmp:
		print (i)<commit_msg>Check for equality in Requirement's test<commit_after>class Requirement:
	def __init__(self, name="", needed=0):
		self.name = name
		self.needed = needed
		self.has = 0
		self.satisfied = False
		self.checkSatisfied()

	def checkSatisfied(self):
		if self.has >= self.needed:
			self.satisfied = True
		else:
			self.satisfied = False

	def incrementHas(self):
		self.has += 1
		self.checkSatisfied()

	def decrementHas(self):
		self.has -= 1
		self.checkSatisfied()

	def __str__(self):
		if self.satisfied:
			ostream = "\u2705"
		else:
			ostream = "\u274C"

		ostream += "  " + self.name + " needs " + str(self.needed)

		if self.satisfied:
			ostream += ", and has "
		else:
			ostream += ", but has "

		ostream += str(self.has) + "."

		return ostream

	def __eq__(self, other):
		return (
			self.name == other.name and
			self.needed == other.needed and
			self.has == other.has and
			self.satisfied == other.satisfied
		)


class RequirementWithValididty(Requirement):
	def __init__(self, name="", needed=0):
		super().__init__(name, needed)
		self.valid = []

	def __eq__(self, other):
		return (
			super().__eq__(other) and
			self.valid == other.valid
		)

	def addCourse(course):
		self.valid.append(course)

	def fulfillsRequirement(course):
		return course in self.valid


class MajorRequirement(RequirementWithValididty):
	def __init__(self, name="", needed=0):
		super().__init__(name, needed)


class SpecialRequirement(RequirementWithValididty):
	def __init__(self, name="", needed=0):
		super().__init__(name, needed)


if __name__ == '__main__':
	tmp = [
		Requirement("Semester in Asia"),
		Requirement("Semester in Japan", 1),
		MajorRequirement("Major Req", 1),
		SpecialRequirement("Special Req"),
		Requirement("Semester in Asia"),
	]
	for i in tmp:
		print (i)

	if tmp[0] == tmp[4]:
		print("success")
{'fraction_non_alphanumeric': 0.14097163718056727, 'fraction_numerical': 0.009547879809042405, 'mean_word_length': 3.8135135135135134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2704223', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1212, 'n_words': 291}