<commit_before>public extension SequenceType {

	@available(*, deprecated=1, renamed="countMatching")
	@warn_unused_result
	public func count(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Int {
		return try countMatching(predicate)
	}


	@warn_unused_result
	public func countMatching(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Int {
		var count = 0
		for element in self where try predicate(element) {
			++count
		}

		return count
	}


	@available(*, deprecated=1, renamed="firstMatching")
	@warn_unused_result
	public func first(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Generator.Element? {
		return try firstMatching(predicate)
	}


	@warn_unused_result
	public func firstMatching(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Generator.Element? {
		for element in self {
			if try predicate(element) {
				return element
			}
		}

		return nil
	}


	@warn_unused_result
	public func separate(@noescape isLeftElement: Generator.Element throws -> Bool) rethrows -> ([Generator.Element], [Generator.Element]) {
		var left = Array<Generator.Element>()
		var right = Array<Generator.Element>()

		for element in self {
			if try isLeftElement(element) {
				left.append(element)
			}
			else {
				right.append(element)
			}
		}

		return (left, right)
	}
}


public extension SequenceType where Generator.Element: AnyObject {

	@warn_unused_result
	public func containsIdentical(element: Generator.Element) -> Bool {
		for existingElement in self where existingElement === element {
			return true
		}

		return false
	}
}<commit_msg>Added SequenceType.filterNonNil()<commit_after>public extension SequenceType {

	@available(*, deprecated=1, renamed="countMatching")
	@warn_unused_result
	public func count(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Int {
		return try countMatching(predicate)
	}


	@warn_unused_result
	public func countMatching(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Int {
		var count = 0
		for element in self where try predicate(element) {
			++count
		}

		return count
	}


	@available(*, deprecated=1, renamed="firstMatching")
	@warn_unused_result
	public func first(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Generator.Element? {
		return try firstMatching(predicate)
	}


	@warn_unused_result
	public func firstMatching(@noescape predicate: Generator.Element throws -> Bool) rethrows -> Generator.Element? {
		for element in self where try predicate(element) {
			return element
		}

		return nil
	}


	@warn_unused_result
	public func separate(@noescape isLeftElement: Generator.Element throws -> Bool) rethrows -> ([Generator.Element], [Generator.Element]) {
		var left = Array<Generator.Element>()
		var right = Array<Generator.Element>()

		for element in self {
			if try isLeftElement(element) {
				left.append(element)
			}
			else {
				right.append(element)
			}
		}

		return (left, right)
	}
}


public extension SequenceType where Generator.Element: AnyObject {

	@warn_unused_result
	public func containsIdentical(element: Generator.Element) -> Bool {
		for existingElement in self where existingElement === element {
			return true
		}

		return false
	}
}



public extension SequenceType where Generator.Element: _Optional {

	@warn_unused_result
	public func filterNonNil() -> [Generator.Element.Wrapped] {
		var result = Array<Generator.Element.Wrapped>()
		for element in self {
			guard let element = element.value else {
				continue
			}

			result.append(element)
		}

		return result
	}
}
{'fraction_non_alphanumeric': 0.09861495844875347, 'fraction_numerical': 0.0016620498614958448, 'mean_word_length': 4.248546511627907, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 31, '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': '663205', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1050, 'n_words': 292}