<commit_before>
from xstruct import pack

from Header import Processed

class Resource(Processed):
	"""\
	 A Resource Description frame consist of:
		* a UInt32, Resource ID
		* a String, singular name of the resource
		* a String, plural name of the resource
		* a String, singular name of the resources unit
		* a String, plural name of the resources unit
		* a String, description of the resource
		* a UInt32, weight per unit of resource (0 for not applicable)
		* a UInt32, size per unit of resource (0 for not applicable)
		* a UInt64, the last modified time of this resource description
	"""
	no = 23
	struct = "SSSSSIIQ"

	def __init__(self, sequence, id, \
			name_singular, name_plural, \
			unit_singular, unit_plural, \
			description, weight, size, modify_time):
		Processed.__init__(self, sequence)

		# Length is:
		#
		self.length = 4 + \
				4 + len(name_singular) + \
				4 + len(name_plural) + \
				4 + len(unit_singular) + \
				4 + len(unit_plural) + \
				4 + len(description) + \
				4 + 4 + 8

		self.id = id
		self.name_singular, self.name_plural = name_singular, name_plural
		self.unit_singular, self.unit_plural = unit_singular, unit_plural
		self.description, self.weight, self.size, self.modify_time = description, weight, size, modify_time
	
	def __str__(self):
		output = Processed.__str__(self)
		output += pack(self.struct, self.id, \
			self.name_singular, self.name_plural, \
			self.unit_singular, self.unit_plural, \
			self.description, self.weight, self.size, self.modify_time)

		return output<commit_msg>Fixed the struct for Resources.<commit_after>
from xstruct import pack

from Header import Processed

class Resource(Processed):
	"""\
	 A Resource Description frame consist of:
		* a UInt32, Resource ID
		* a String, singular name of the resource
		* a String, plural name of the resource
		* a String, singular name of the resources unit
		* a String, plural name of the resources unit
		* a String, description of the resource
		* a UInt32, weight per unit of resource (0 for not applicable)
		* a UInt32, size per unit of resource (0 for not applicable)
		* a UInt64, the last modified time of this resource description
	"""
	no = 23
	struct = "ISSSSSIIQ"

	def __init__(self, sequence, id, \
			name_singular, name_plural, \
			unit_singular, unit_plural, \
			description, weight, size, modify_time):
		Processed.__init__(self, sequence)

		# Length is:
		#
		self.length = 4 + \
				4 + len(name_singular) + \
				4 + len(name_plural) + \
				4 + len(unit_singular) + \
				4 + len(unit_plural) + \
				4 + len(description) + \
				4 + 4 + 8

		self.id = id
		self.name_singular, self.name_plural = name_singular, name_plural
		self.unit_singular, self.unit_plural = unit_singular, unit_plural
		self.description, self.weight, self.size, self.modify_time = description, weight, size, modify_time
	
	def __str__(self):
		output = Processed.__str__(self)
		output += pack(self.struct, self.id, \
			self.name_singular, self.name_plural, \
			self.unit_singular, self.unit_plural, \
			self.description, self.weight, self.size, self.modify_time)

		return output
{'fraction_non_alphanumeric': 0.09669129457115323, 'fraction_numerical': 0.013491808544812078, 'mean_word_length': 3.565982404692082, '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': '6496603', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1002, 'n_words': 321}