<commit_before>module TalentsHelper
	include Utils

	def talent_counts_table class_id
		h = Hash.new
		@class_talents = Talents.get_talents class_id

		@talent_counts.each do |id, count|
			talent = @class_talents[id]
			talent[:percent] = (count.to_f / @total * 100).round(1)
			k = "#{talent[:tier]}-#{talent[:col]}"
			h[k] = talent
		end

		fill_missing h if h.size < 21
		assign_highest h
		return h
	end

	private<commit_msg>added nil check for talent counts<commit_after>module TalentsHelper
	include Utils

	def talent_counts_table class_id
		h = Hash.new
		@class_talents = Talents.get_talents class_id

		@talent_counts.each do |id, count|
			talent = @class_talents[id]
			next if talent.nil?
			talent[:percent] = (count.to_f / @total * 100).round(1)
			k = "#{talent[:tier]}-#{talent[:col]}"
			h[k] = talent
		end

		fill_missing h if h.size < 21
		assign_highest h
		return h
	end

	private
{'fraction_non_alphanumeric': 0.11491712707182321, 'fraction_numerical': 0.013259668508287293, 'mean_word_length': 3.7936507936507935, 'pattern_counts': {'":': 0, '<': 5, '<?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': '749525', 'n_tokens_mistral': 400, 'n_tokens_neox': 345, 'n_words': 83}