<commit_before>package arrays

// Checks if string exists in a slice
// Returns the key for needle if it is found in the slice, -1 otherwise.
func StringInSlice(haystack []string, needle string) (result int) {
	result = -1

	for k, v := range haystack {
		if v == needle {
			result = k
			break
		}
	}

	return
}<commit_msg>Added function for checking if the integer is in slice.<commit_after>package arrays

// Checks if string exists in a slice
// Returns the key for needle if it is found in the slice, -1 otherwise.
func StringInSlice(haystack []string, needle string) (result int) {
	result = -1

	for k, v := range haystack {
		if v == needle {
			result = k
			break
		}
	}

	return
}

// Checks if integer exists in a slice
// Returns the index for needle if it is found in the slice, -1 otherwise.
func IntInSlice(haystack []int, needle int) (index int) {
	index = -1

	for k, v := range haystack {
		if v == needle {
			index = k
			break
		}
	}

	return
}
{'fraction_non_alphanumeric': 0.09410548086866598, 'fraction_numerical': 0.0062047569803516025, 'mean_word_length': 2.919028340080972, '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': '5583375', 'n_tokens_mistral': 333, 'n_tokens_neox': 304, 'n_words': 139}