<commit_before>//
//  AKTester.swift
//  AudioKit
//
//  Created by <NAME> on 11/30/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import AVFoundation

/// Testing node
public struct AKTester: AKNode {

    // MARK: - Properties
    
    private var internalAU: AKTesterAudioUnit?
    
    /// Required property for AKNode
    public var avAudioNode: AVAudioNode
    /// Required property for AKNode containing all the node's connections
    public var connectionPoints = [AVAudioConnectionPoint]()
    
    private var token: AUParameterObserverToken?
    var totalSamples = 0
    
    /// Calculate the MD5
    public var MD5: String {
        return (self.internalAU?.getMD5())!
    }
    
    /// Flag on whether or not the test is still in progress
    public var isTesting: Bool {
        return Int((self.internalAU?.getSamples())!) < totalSamples
    }

    // MARK: - Initializers

    /// Initialize this test node
    ///
    /// - parameter input: AKNode to test
    /// - parameter sample: Number of sample to product
    ///
    public init(var _ input: AKNode, samples: Int) {
        
        totalSamples = samples

        var description = AudioComponentDescription()
        description.componentType         = kAudioUnitType_Effect
        description.componentSubType      = 0x74737472 /*'tstr'*/
        description.componentManufacturer = 0x41754b74 /*'AuKt'*/
        description.componentFlags        = 0
        description.componentFlagsMask    = 0

        AUAudioUnit.registerSubclass(
            AKTesterAudioUnit.self,
            asComponentDescription: description,
            name: "Local AKTester",
            version: UInt32.max)

        self.avAudioNode = AVAudioNode()
        AVAudioUnit.instantiateWithComponentDescription(description, options: []) {
            avAudioUnit, error in

            guard let avAudioUnitEffect = avAudioUnit else { return }

            self.avAudioNode = avAudioUnitEffect
            self.internalAU = avAudioUnitEffect.AUAudioUnit as? AKTesterAudioUnit

            AKManager.sharedInstance.engine.attachNode(self.avAudioNode)
            input.addConnectionPoint(self)
            self.internalAU?.setSamples(Int32(samples))
        }

        guard let tree = internalAU?.parameterTree else { return }


        token = tree.tokenByAddingParameterObserver {
            address, value in

            dispatch_async(dispatch_get_main_queue()) {
            }
        }

    }
}<commit_msg>Removed unnecessary code bit<commit_after>//
//  AKTester.swift
//  AudioKit
//
//  Created by <NAME> on 11/30/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import AVFoundation

/// Testing node
public struct AKTester: AKNode {

    // MARK: - Properties
    
    private var internalAU: AKTesterAudioUnit?
    
    /// Required property for AKNode
    public var avAudioNode: AVAudioNode
    /// Required property for AKNode containing all the node's connections
    public var connectionPoints = [AVAudioConnectionPoint]()
    
    private var token: AUParameterObserverToken?
    var totalSamples = 0
    
    /// Calculate the MD5
    public var MD5: String {
        return (self.internalAU?.getMD5())!
    }
    
    /// Flag on whether or not the test is still in progress
    public var isTesting: Bool {
        return Int((self.internalAU?.getSamples())!) < totalSamples
    }

    // MARK: - Initializers

    /// Initialize this test node
    ///
    /// - parameter input: AKNode to test
    /// - parameter sample: Number of sample to product
    ///
    public init(var _ input: AKNode, samples: Int) {
        
        totalSamples = samples

        var description = AudioComponentDescription()
        description.componentType         = kAudioUnitType_Effect
        description.componentSubType      = 0x74737472 /*'tstr'*/
        description.componentManufacturer = 0x41754b74 /*'AuKt'*/
        description.componentFlags        = 0
        description.componentFlagsMask    = 0

        AUAudioUnit.registerSubclass(
            AKTesterAudioUnit.self,
            asComponentDescription: description,
            name: "Local AKTester",
            version: UInt32.max)

        self.avAudioNode = AVAudioNode()
        AVAudioUnit.instantiateWithComponentDescription(description, options: []) {
            avAudioUnit, error in

            guard let avAudioUnitEffect = avAudioUnit else { return }

            self.avAudioNode = avAudioUnitEffect
            self.internalAU = avAudioUnitEffect.AUAudioUnit as? AKTesterAudioUnit

            AKManager.sharedInstance.engine.attachNode(self.avAudioNode)
            input.addConnectionPoint(self)
            self.internalAU?.setSamples(Int32(samples))
        }
    }
}
{'fraction_non_alphanumeric': 0.08594902043395829, 'fraction_numerical': 0.015588792921845377, 'mean_word_length': 2.2409556313993173, 'pattern_counts': {'":': 0, '<': 9, '<?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': '408190', 'n_tokens_mistral': 1361, 'n_tokens_neox': 1225, 'n_words': 327}