<commit_before>//
//  FBSimulator+PXCTestKit.swift
//  pxctest
//
//  Created by <NAME> on 04/12/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import FBSimulatorControl
import Foundation

extension Sequence where Iterator.Element == FBSimulator {

    func boot(context: RunTestsCommand.Context) throws {
        let simulatorBootConfiguration = FBSimulatorBootConfiguration
            .withLocalizationOverride(FBLocalizationOverride.withLocale(context.locale))
            .withOptions(context.simulatorBootOptions)

        for simulator in self {
            if simulator.state == .booted {
                continue
            }

            try simulator.interact
                .prepare(forBoot: simulatorBootConfiguration)
                .bootSimulator(simulatorBootConfiguration)
                .perform()
        }
    }

    func loadPreferences(context: RunTestsCommand.Context) throws {
        for simulator in self {
            try simulator.interact
                .loadPreferences(context.preferences)
                .perform()
        }
    }

}
<commit_msg>Move Sequence extension code around<commit_after>//
//  FBSimulator+PXCTestKit.swift
//  pxctest
//
//  Created by <NAME> on 04/12/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import FBSimulatorControl
import Foundation

extension FBSimulator {

    func boot(context: RunTestsCommand.Context) throws {
        guard state != .booted else { return }
        let simulatorBootConfiguration = FBSimulatorBootConfiguration
            .withLocalizationOverride(FBLocalizationOverride.withLocale(context.locale))
            .withOptions(context.simulatorBootOptions)
        try interact
            .prepare(forBoot: simulatorBootConfiguration)
            .bootSimulator(simulatorBootConfiguration)
            .perform()
    }

    func loadPreferences(context: RunTestsCommand.Context) throws {
        try interact
            .loadPreferences(context.preferences)
            .perform()
    }

}

extension Sequence where Iterator.Element == FBSimulator {

    func boot(context: RunTestsCommand.Context) throws {
        for simulator in self {
            try simulator.boot(context: context)
        }
    }

    func loadPreferences(context: RunTestsCommand.Context) throws {
        for simulator in self {
            try simulator.loadPreferences(context: context)
        }
    }

}

{'fraction_non_alphanumeric': 0.08034970857618651, 'fraction_numerical': 0.00832639467110741, 'mean_word_length': 2.3514644351464433, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2552401', 'n_tokens_mistral': 655, 'n_tokens_neox': 601, 'n_words': 139}