<commit_before>
import Foundation
import UIKit

class MainViewController: UIViewController {
    
    @IBOutlet weak var previewVideoView: VideoView!
    @IBOutlet weak var onAirVideoView: VideoView!
    @IBOutlet var cameraVideoViews: [VideoView]! {
        didSet {
            for (i,v) in cameraVideoViews.enumerate() {
                v.videoConnection?.start(withHandler: { (image:UIImage) -> Void in
                    dispatch_async(dispatch_get_main_queue(),{
                        v.setImage(image, forState: .Normal)
                        if i == self.previewCamera { self.previewVideoView.setImage(image, forState: .Normal)}
                        if i == self.onAirCamera { self.onAirVideoView.setImage(image, forState: .Normal)}
                    })
                })
            }
        }
    }
    
    var onAirCamera: Int?  {
        didSet {
            if onAirCamera != oldValue {
                reconfigureCameraFrameColor()
            }
        }
    }

    var previewCamera: Int? {
        didSet {
            if previewCamera != oldValue {
                reconfigureCameraFrameColor()
            }
        }
    }
    
    func reconfigureCameraFrameColor() {
        for (i,v) in cameraVideoViews.enumerate() {
            if self.onAirCamera == i {
                v.frameColor = onAirVideoView.color
            }
            else if self.previewCamera == i {
                v.frameColor = previewVideoView.color
            }
            else {
                v.frameColor = nil
            }
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func cameraSelected(sender: VideoView) {
        if let cameraIdx = cameraVideoViews.indexOf(sender), let _ = sender.videoConnection {
            previewCamera = cameraIdx
        }
        
    }
    @IBAction func previewToOnAirPressed(sender: AnyObject) {
        if let cameraIdx = previewCamera, let _ = previewVideoView.videoURL {
            onAirCamera = cameraIdx
        }
    }
}
<commit_msg>move onair<commit_after>
import Foundation
import UIKit

class MainViewController: UIViewController {
    
    @IBOutlet weak var previewVideoView: VideoView!
    @IBOutlet weak var onAirVideoView: VideoView!
    @IBOutlet var cameraVideoViews: [VideoView]! {
        didSet {
            for (i,v) in cameraVideoViews.enumerate() {
                v.videoConnection?.start(withHandler: { (image:UIImage) -> Void in
                    dispatch_async(dispatch_get_main_queue(),{
                        v.setImage(image, forState: .Normal)
                        if i == self.previewCamera { self.previewVideoView.setImage(image, forState: .Normal)}
                        if i == self.onAirCamera { self.onAirVideoView.setImage(image, forState: .Normal)}
                    })
                })
            }
        }
    }
    
    var onAirCamera: Int?  {
        didSet {
            if onAirCamera != oldValue {
                reconfigureCameraFrameColor()
            }
        }
    }

    var previewCamera: Int? {
        didSet {
            if previewCamera != oldValue {
                reconfigureCameraFrameColor()
            }
        }
    }
    
    func reconfigureCameraFrameColor() {
        for (i,v) in cameraVideoViews.enumerate() {
            if self.onAirCamera == i {
                v.frameColor = onAirVideoView.color
            }
            else if self.previewCamera == i {
                v.frameColor = previewVideoView.color
            }
            else {
                v.frameColor = nil
            }
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    func goOnAir() {
        if let cameraIdx = previewCamera {
            onAirCamera = cameraIdx
        }
    }
    
    @IBAction func cameraSelected(sender: VideoView) {
        if let cameraIdx = cameraVideoViews.indexOf(sender), let _ = sender.videoConnection {
            previewCamera = cameraIdx
        }
        
    }
    @IBAction func previewToOnAirPressed(sender: AnyObject) {
        goOnAir()
    }
}

{'fraction_non_alphanumeric': 0.08377853326857698, 'fraction_numerical': 0.0, 'mean_word_length': 1.5473098330241188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6597885', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1091, 'n_words': 224}