<commit_before>//  Copyright (c) 2015 <NAME>. All rights reserved.

extension Dictionary {
	init<S: SequenceType where S.Generator.Element == Element>(_ elements: S) {
		self.init()
		var generator = elements.generate()
		let next: () -> Element? = { generator.next() }
		for (key, value) in GeneratorOf(next) {
			updateValue(value, forKey: key)
		}
	}

	func filter(includeKeyAndValue: Element -> Bool) -> Dictionary {
		return Dictionary(Swift.filter(self, includeKeyAndValue))
	}

	func map<MappedKey: Hashable, MappedValue>(f: Element -> (MappedKey, MappedValue)) -> Dictionary<MappedKey, MappedValue> {
		return Dictionary<MappedKey, MappedValue>(Swift.map(self, f))
	}
}<commit_msg>Dictionary.filter is lazy.<commit_after>//  Copyright (c) 2015 <NAME>. All rights reserved.

extension Dictionary {
	init<S: SequenceType where S.Generator.Element == Element>(_ elements: S) {
		self.init()
		var generator = elements.generate()
		let next: () -> Element? = { generator.next() }
		for (key, value) in GeneratorOf(next) {
			updateValue(value, forKey: key)
		}
	}

	func filter(includeKeyAndValue: Element -> Bool) -> Dictionary {
		return Dictionary(lazy(self).filter(includeKeyAndValue))
	}

	func map<MappedKey: Hashable, MappedValue>(f: Element -> (MappedKey, MappedValue)) -> Dictionary<MappedKey, MappedValue> {
		return Dictionary<MappedKey, MappedValue>(Swift.map(self, f))
	}
}
{'fraction_non_alphanumeric': 0.14316546762589927, 'fraction_numerical': 0.0057553956834532375, 'mean_word_length': 4.84453781512605, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, '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': '2123028', 'n_tokens_mistral': 479, 'n_tokens_neox': 440, 'n_words': 109}