<commit_before>//
//  XCTestCase+Async.swift
//  edX
//
//  Created by <NAME> on 6/3/15.
//  Copyright (c) 2015 edX. All rights reserved.
//

import Foundation
import XCTest
import edX

extension XCTestCase {
    
    // Standardize on a reasonable timeout to account for slow CI systems interacting with slow operations like
    // screenshot generation. Also makes it easier to change to a long number when debugging
    func waitForExpectations(handler : XCWaitCompletionHandler? = nil) {
        waitForExpectationsWithTimeout(10, handler: handler)
    }
    
    func waitForStream<A>(stream : Stream<A>, fireIfAlreadyLoaded: Bool = true, verifier : (Result<A> -> Void)? = nil) {
        let expectation = expectationWithDescription("stream fires")
        stream.extendLifetimeUntilFirstResult(fireIfAlreadyLoaded: fireIfAlreadyLoaded) {
            verifier?($0)
            expectation.fulfill()
        }
        waitForExpectations()
    }
    
    func verifyInNextRunLoop(action : () -> Void) {
        let expectation = expectationWithDescription("run loop iterates")
        dispatch_async(dispatch_get_main_queue()) {
            action()
            expectation.fulfill()
        }
        waitForExpectations()
    }
}<commit_msg>Increase test timeout<commit_after>//
//  XCTestCase+Async.swift
//  edX
//
//  Created by <NAME> on 6/3/15.
//  Copyright (c) 2015 edX. All rights reserved.
//

import Foundation
import XCTest
import edX

extension XCTestCase {
    
    // Standardize on a reasonable timeout to account for slow CI systems interacting with slow operations like
    // screenshot generation. Also makes it easier to change to a long number when debugging
    func waitForExpectations(handler : XCWaitCompletionHandler? = nil) {
        waitForExpectationsWithTimeout(15, handler: handler)
    }
    
    func waitForStream<A>(stream : Stream<A>, fireIfAlreadyLoaded: Bool = true, verifier : (Result<A> -> Void)? = nil) {
        let expectation = expectationWithDescription("stream fires")
        stream.extendLifetimeUntilFirstResult(fireIfAlreadyLoaded: fireIfAlreadyLoaded) {
            verifier?($0)
            expectation.fulfill()
        }
        waitForExpectations()
    }
    
    func verifyInNextRunLoop(action : () -> Void) {
        let expectation = expectationWithDescription("run loop iterates")
        dispatch_async(dispatch_get_main_queue()) {
            action()
            expectation.fulfill()
        }
        waitForExpectations()
    }
}
{'fraction_non_alphanumeric': 0.09192645883293366, 'fraction_numerical': 0.008792965627498001, 'mean_word_length': 2.8330781010719757, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '5294920', 'n_tokens_mistral': 709, 'n_tokens_neox': 674, 'n_words': 184}