<commit_before>Antifreeze.Model = class Model
	Calamity.emitter @prototype

	# Default values are assigned automatically.
	# Any functions will be executed in the context of the values object, and the return value will be the value.
	defaults: {}

	# Constructor.
	constructor: (values) ->
		# Prepare internal containers.
		@_values = {}
		# Populate default values.
		values = @_defaults values
		# Set values.
		@set values

	# Populates default values.
	_defaults: (values) ->
		for own key, val of @defaults
			# Ignore existing values.
			continue if values[key]?
			# Execute default function.
			if _.isFunction val
				values[key] = val.apply values
		return values

	# Sets one or more values.
	# Can be called with a key and value, or with an object.
	set: (keyOrObj, val) ->
		return unless keyOrObj
		# Convert to object.
		obj = keyOrObj
		unless _.isObject obj
			o = {}<commit_msg>Added ID function on Model<commit_after>Antifreeze.Model = class Model
	Calamity.emitter @prototype

	# Default values are assigned automatically.
	# Any functions will be executed in the context of the values object, and the return value will be the value.
	defaults: {}

	# Constructor.
	constructor: (values) ->
		# ID.
		@_id = null
		# Prepare internal containers.
		@_values = {}
		# Populate default values.
		values = @_defaults values
		# Set values.
		@set values

	# Populates default values.
	_defaults: (values) ->
		for own key, val of @defaults
			# Ignore existing values.
			continue if values[key]?
			# Execute default function.
			if _.isFunction val
				values[key] = val.apply values
		return values

	# ID getter/setter.
	id: (id) ->
		if id?
			@_id = id
		return @_id

	# Sets one or more values.
	# Can be called with a key and value, or with an object.
	set: (keyOrObj, val) ->
		return unless keyOrObj
		# Convert to object.
		obj = keyOrObj
		unless _.isObject obj
			o = {}
{'fraction_non_alphanumeric': 0.0863157894736842, 'fraction_numerical': 0.0, 'mean_word_length': 3.1416122004357296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '61834', 'n_tokens_mistral': 654, 'n_tokens_neox': 584, 'n_words': 233}