<commit_before>import UIKit
@testable import Scenic

class MockScene: Scene {

    let viewController: UIViewController

    var eventDelegate: EventDelegate?

    private(set) var children: [Scene] = []

    private(set) var customData: [AnyHashable: AnyHashable]?

    init(viewController: UIViewController = UIViewController()) {
        self.viewController = viewController
    }

    func embed(_ children: [Scene], customData: [AnyHashable: AnyHashable]?) {
        self.children = children
        self.customData = customData
    }

    func triggerEvent() {
        eventDelegate?.sendEvent(NavigationEvent(eventName: "MockScene/event"))
    }
}

class MockSceneFactory: SceneFactory {

    private let sceneConstructors: [String: () -> Scene]

    init(scenes: [String: Scene] = [:]) {
        sceneConstructors = scenes.mapValues { scene in return { scene } }
    }

    init(scene constructor: @autoclosure @escaping () -> Scene, for sceneName: String) {
        sceneConstructors = [sceneName: constructor]
    }

    func makeScene(for sceneName: String) -> Scene? {
        return sceneConstructors[sceneName]?()
    }
}

class MockEventDelegate: EventDelegate {

    private(set) var sentEvents: [NavigationEvent] = []

    func sendEvent(_ event: NavigationEvent) {
        sentEvents.append(event)
    }
}
<commit_msg>Provide separate closure initializer for MockSceneFactory<commit_after>import UIKit
@testable import Scenic

class MockScene: Scene {

    let viewController: UIViewController

    var eventDelegate: EventDelegate?

    private(set) var children: [Scene] = []

    private(set) var customData: [AnyHashable: AnyHashable]?

    init(viewController: UIViewController = UIViewController()) {
        self.viewController = viewController
    }

    func embed(_ children: [Scene], customData: [AnyHashable: AnyHashable]?) {
        self.children = children
        self.customData = customData
    }

    func triggerEvent() {
        eventDelegate?.sendEvent(NavigationEvent(eventName: "MockScene/event"))
    }
}

class MockSceneFactory: SceneFactory {

    private let sceneConstructors: [String: () -> Scene]

    init(scenes constructors: [String: () -> Scene]) {
        sceneConstructors = constructors
    }

    convenience init(scenes: [String: Scene] = [:]) {
        self.init(scenes: scenes.mapValues { scene in return { scene } })
    }

    convenience init(scene: Scene, for sceneName: String) {
        self.init(scenes: [sceneName: scene])
    }

    func makeScene(for sceneName: String) -> Scene? {
        return sceneConstructors[sceneName]?()
    }
}

class MockEventDelegate: EventDelegate {

    private(set) var sentEvents: [NavigationEvent] = []

    func sendEvent(_ event: NavigationEvent) {
        sentEvents.append(event)
    }
}

{'fraction_non_alphanumeric': 0.10773085182534002, 'fraction_numerical': 0.0, 'mean_word_length': 3.4154818325434437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6689197', 'n_tokens_mistral': 822, 'n_tokens_neox': 773, 'n_words': 190}