<commit_before>var angular_multi_select = angular.module('angular-multi-select');

angular_multi_select.filter('translate', [
	'angularMultiSelectI18n',
	function (angularMultiSelectI18n) {
		return function (text) {
			return angularMultiSelectI18n.translate(text);
		};
	}
]);

angular_multi_select.filter('outputModelIterator', [
	'angularMultiSelectConstants',
	'angularMultiSelectStylesHelper',
	function (angularMultiSelectConstants, angularMultiSelectStylesHelper) {
		return function (text, data, glue, default_str) {
			var exp, output = [];
			var amssh = new angularMultiSelectStylesHelper();

			if (!data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_MODEL_HACK]) {
				return default_str || "";
			}

			switch (data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_TYPE_HACK]) {
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_OBJECTS:
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_ARRAYS:
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_VALUES:
					data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_MODEL_HACK].map(function (v) {
						exp = amssh.interpolate_alternative2(text);
						output.push(exp(v));
					});
					break;
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_OBJECT:
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_ARRAY:<commit_msg>Better handle empty output in outputModelIterator filter<commit_after>var angular_multi_select = angular.module('angular-multi-select');

angular_multi_select.filter('translate', [
	'angularMultiSelectI18n',
	function (angularMultiSelectI18n) {
		return function (text) {
			return angularMultiSelectI18n.translate(text);
		};
	}
]);

angular_multi_select.filter('outputModelIterator', [
	'angularMultiSelectConstants',
	'angularMultiSelectStylesHelper',
	function (angularMultiSelectConstants, angularMultiSelectStylesHelper) {
		return function (text, data, glue, default_str) {
			var exp, output = [];
			var amssh = new angularMultiSelectStylesHelper();

			if (!data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_MODEL_HACK] || data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_MODEL_HACK].length === 0) {
				return default_str || "";
			}

			switch (data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_TYPE_HACK]) {
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_OBJECTS:
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_ARRAYS:
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_VALUES:
					data[angularMultiSelectConstants.INTERNAL_KEY_OUTPUT_MODEL_HACK].map(function (v) {
						exp = amssh.interpolate_alternative2(text);
						output.push(exp(v));
					});
					break;
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_OBJECT:
				case angularMultiSelectConstants.OUTPUT_DATA_TYPE_ARRAY:
{'fraction_non_alphanumeric': 0.0912087912087912, 'fraction_numerical': 0.005494505494505495, 'mean_word_length': 6.523415977961433, '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': '4608138', 'n_tokens_mistral': 924, 'n_tokens_neox': 803, 'n_words': 113}