<commit_before>import Foundation

extension Array {
	func optionalElementAtIndex(index:Int) -> Array.Generator.Element? {
		if self.count > index {
			return self[index]
		}
		return nil
	}
}<commit_msg>Array+Dictionary 'any' extension<commit_after>import Foundation

extension Array {
	func optionalElementAtIndex(index:Int) -> Array.Generator.Element? {
		if self.count > index {
			return self[index]
		}
		return nil
	}
}

extension Array {
    func any (test:(Element)->Bool ) -> Bool {
        for element in self {
            if test(element) { return true }
        }
        return false
    }
}


extension Dictionary {
    func any (test:(Value)->Bool ) -> Key? {
        for (key,value) in self {
            if test(value) { return key }
        }
        return nil
    }
}
{'fraction_non_alphanumeric': 0.11040609137055837, 'fraction_numerical': 0.0, 'mean_word_length': 2.5223214285714284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6182665', 'n_tokens_mistral': 250, 'n_tokens_neox': 232, 'n_words': 62}