<commit_before>//
//  SequenceType.swift
//  ZamzamKit
//
//  Created by <NAME> on 2/20/16.
//  Copyright © 2016 Zamzam. All rights reserved.
//

import Foundation

public extension SequenceType {
    
    /**
     Returns the first that satisfies the predicate includeElement, or nil. Similar to `filter` but stops when one element is found. Thanks to [bigonotetaking](https://bigonotetaking.wordpress.com/2015/08/22/using-higher-order-methods-everywhere/)
     
     - parameter predicate: Predicate that the Element must satisfy.
     
     - returns: First element that satisfies the predicate, or nil.
     */
    public func first(@noescape predicate: Generator.Element -> Bool) -> Generator.Element? {
        for x in self where predicate(x) { return x }
        return nil
    }
    
    /**
     Returns true or false if the predicate includeElement
     
     - parameter predicate: Predicate that the Element must satisfy
     
     - returns: Does element exists that satisfies the predicate
     */
    public func any(@noescape predicate: Generator.Element -> Bool) -> Bool {
        return contains(predicate)
    }
    
    /**
     Returns true or false if the predicate returns all elements
     
     - parameter predicate: Predicate that all elements must satisfy
     
     - returns: Does the sequence contain all elements that satisfy the predicate
     */
    public func all(@noescape predicate:(Generator.Element) -> Bool) -> Bool {
        return !contains { !predicate($0) }
    }
}<commit_msg>Removed custom any in favor of native contains.<commit_after>//
//  SequenceType.swift
//  ZamzamKit
//
//  Created by <NAME> on 2/20/16.
//  Copyright © 2016 Zamzam. All rights reserved.
//

import Foundation

public extension SequenceType {
    
    /**
     Returns the first that satisfies the predicate includeElement, or nil. Similar to `filter` but stops when one element is found. Thanks to [bigonotetaking](https://bigonotetaking.wordpress.com/2015/08/22/using-higher-order-methods-everywhere/)
     
     - parameter predicate: Predicate that the Element must satisfy.
     
     - returns: First element that satisfies the predicate, or nil.
     */
    public func first(@noescape predicate: Generator.Element -> Bool) -> Generator.Element? {
        for x in self where predicate(x) { return x }
        return nil
    }
    
    /**
     Returns true or false if the predicate returns all elements
     
     - parameter predicate: Predicate that all elements must satisfy
     
     - returns: Does the sequence contain all elements that satisfy the predicate
     */
    public func all(@noescape predicate:(Generator.Element) -> Bool) -> Bool {
        return !contains { !predicate($0) }
    }
}
{'fraction_non_alphanumeric': 0.08808479532163743, 'fraction_numerical': 0.013157894736842105, 'mean_word_length': 2.6108179419525066, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '3730588', 'n_tokens_mistral': 780, 'n_tokens_neox': 708, 'n_words': 270}