<commit_before>module ExerciseHelper

	def teachers_combo teachers
		return nil if teachers.nil?
		options_for_select(teachers.each.map { |t| [t.name,t.id] })
	end
	def courses_combo courses
		return nil if courses.nil?
		options_for_select(courses.each.map{|c| [c.name,c.id]})
	end
	def homeworks_combo homeworks
		return nil if homeworks.nil?
		options_for_select(homeworks.each.map{|h| [h.name,h.id]})
	end
end<commit_msg>Refactorize combo setup helpers<commit_after>module ExerciseHelper

	def teachers_combo teachers
		return teachers.nil? ? nil : create_combo(teachers) 
	end
	def courses_combo courses
		return courses.nil? ? nil : create_combo(courses)
	end
	def homeworks_combo homeworks
		return homeworks.nil? ? nil : create_combo(homeworks)
	end
	def create_combo items
		options_for_select(items.each.map{|i| [i.name,i.id]})
	end
end
{'fraction_non_alphanumeric': 0.09692671394799054, 'fraction_numerical': 0.0, 'mean_word_length': 5.227941176470588, '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': '7532456', 'n_tokens_mistral': 324, 'n_tokens_neox': 304, 'n_words': 69}