<commit_before>public func any<S : SequenceType>(source: S, includeElement: (S.Generator.Element) -> Bool) -> Bool {
	for element in source {
		if includeElement(element) {
			return true
		}
	}

	return false
}


public func findIdentical<C: CollectionType where C.Generator.Element: AnyObject>(collection: C, element: C.Generator.Element) -> C.Index? {
	for index in collection.startIndex ..< collection.endIndex {
		if collection[index] === element {
			return index
		}
	}

	return nil
}


public func findLast<C: CollectionType where C.Generator.Element: Equatable, C.Index: BidirectionalIndexType>(collection: C, element: C.Generator.Element) -> C.Index? {
	for index in reverse(collection.startIndex ..< collection.endIndex) {
		if collection[index] == element {
			return index
		}
	}

	return nil
}


public func first<S : SequenceType>(source: S, includeElement: (S.Generator.Element) -> Bool) -> S.Generator.Element? {
	for element in source {
		if includeElement(element) {
			return element
		}
	}

	return nil
}


public func max <T: Comparable>(x: T?, y: T?) -> T? {
	if let x = x, y = y {
		return Swift.max(x, y)
	}
	else if let x = x {
		return x
	}
	else {
		return y
	}
}


public func max <T: Comparable>(x: T, y: T?) -> T? {
	if let y = y {
		return Swift.max(x, y)
	}
	else {
		return x
	}
}


public func max <T: Comparable>(x: T?, y: T) -> T? {
	if let x = x {
		return Swift.max(x, y)
	}
	else {
		return y
	}
}


public func min <T: Comparable>(x: T?, y: T?) -> T? {
	if let x = x, y = y {
		return Swift.min(x, y)
	}
	else if let x = x {
		return x
	}
	else {
		return y
	}
}


public func min <T: Comparable>(x: T, y: T?) -> T? {
	if let y = y {
		return Swift.min(x, y)
	}
	else {
		return x
	}
}


public func min <T: Comparable>(x: T?, y: T) -> T? {
	if let x = x {
		return Swift.min(x, y)
	}
	else {
		return y
	}
}


public func not<T>(source: T -> Bool) -> T -> Bool {
	return { !source($0) }
}


public func not<T>(source: Bool) -> Bool {
	return !source
}


public func removeFirst<C : RangeReplaceableCollectionType where C.Generator.Element : Equatable>(inout collection: C, element: C.Generator.Element) -> C.Index? {
	let index = find(collection, element)
	if let index = index {
		collection.removeAtIndex(index)
	}

	return index
}

<commit_msg>Added internal arc4random(), renamed optional-supporting min/max to optionalMin/optionalMax and added support for more than two values.<commit_after>public func any<S : SequenceType>(source: S, includeElement: (S.Generator.Element) -> Bool) -> Bool {
	for element in source {
		if includeElement(element) {
			return true
		}
	}

	return false
}


internal func arc4random<T: IntegerLiteralConvertible>(type: T.Type) -> T {
	var random: T = 0
	arc4random_buf(&random, sizeof(T))
	return random
}


public func findIdentical<C: CollectionType where C.Generator.Element: AnyObject>(collection: C, element: C.Generator.Element) -> C.Index? {
	for index in collection.startIndex ..< collection.endIndex {
		if collection[index] === element {
			return index
		}
	}

	return nil
}


public func findLast<C: CollectionType where C.Generator.Element: Equatable, C.Index: BidirectionalIndexType>(collection: C, element: C.Generator.Element) -> C.Index? {
	for index in reverse(collection.startIndex ..< collection.endIndex) {
		if collection[index] == element {
			return index
		}
	}

	return nil
}


public func first<S : SequenceType>(source: S, includeElement: (S.Generator.Element) -> Bool) -> S.Generator.Element? {
	for element in source {
		if includeElement(element) {
			return element
		}
	}

	return nil
}

public func not<T>(source: T -> Bool) -> T -> Bool {
	return { !source($0) }
}


public func not<T>(source: Bool) -> Bool {
	return !source
}


public func optionalMax <T: Comparable>(elements: T? ...) -> T? {
	var maximumElement: T?

	for element in elements {
		if let element = element {
			if let existingMaximumElement = maximumElement {
				if element > existingMaximumElement {
					maximumElement = element
				}
			}
			else {
				maximumElement = element
			}
		}
	}

	return maximumElement
}


public func optionalMin <T: Comparable>(elements: T? ...) -> T? {
	var minimumElement: T?

	for element in elements {
		if let element = element {
			if let existingMinimumElement = minimumElement {
				if element < existingMinimumElement {
					minimumElement = element
				}
			}
			else {
				minimumElement = element
			}
		}
	}

	return minimumElement
}


public func removeFirst<C : RangeReplaceableCollectionType where C.Generator.Element : Equatable>(inout collection: C, element: C.Generator.Element) -> C.Index? {
	let index = find(collection, element)
	if let index = index {
		collection.removeAtIndex(index)
	}

	return index
}


{'fraction_non_alphanumeric': 0.12723825574046765, 'fraction_numerical': 0.0012639561828523278, 'mean_word_length': 3.3962962962962964, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 58, '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': '7565901', 'n_tokens_mistral': 1737, 'n_tokens_neox': 1568, 'n_words': 475}