<commit_before>import Cocoa

// in the storyboard, ensure the NSTabView's delegate is set to this controller object

class PreferencesViewController: NSTabViewController {
   
    lazy var originalSizes = [String : NSSize]()
    
    // MARK: - NSTabViewDelegate
    
    // in the storyboard, ensure the view controller's transition checkboxes are all off

    override func tabView(tabView: NSTabView, willSelectTabViewItem tabViewItem: NSTabViewItem) {
        super.tabView(tabView, willSelectTabViewItem: tabViewItem)
        
        let currentTabViewItem = tabView.selectedTabViewItem?
        if (currentTabViewItem != nil) {
            currentTabViewItem!.view!.hidden = true
        }
        tabViewItem.view!.hidden = true
        
        // for each tabViewItem, save the original, as-laid-out-in-IB view sizes, so it can be used to resize the window with the selected tab changes
        var size = (tabViewItem.view?.frame.size)!
        var originalSize = self.originalSizes[tabViewItem.label]
        if (originalSize != nil) {
            size = originalSize!
        } else {
            self.originalSizes[tabViewItem.label] = size
        }
        
        let window = self.view.window
        if (window != nil) {
            window?.title = tabViewItem.label

            var frame = (window?.frame)!
            frame.origin.y = frame.origin.y + (frame.size.height - size.height)
            frame.size.height = size.height;
            frame.size.width = size.width;
            window?.setFrame(frame, display: true, animate: true)
        }
    }
    
    override func tabView(tabView: NSTabView, didSelectTabViewItem tabViewItem: NSTabViewItem) {<commit_msg>Update comments<commit_after>import Cocoa

// in the storyboard, ensure the view controller's transition checkboxes are all off, and the NSTabView's delegate is set to this controller object

class PreferencesViewController: NSTabViewController {
   
    lazy var originalSizes = [String : NSSize]()
    
    // MARK: - NSTabViewDelegate
    
    override func tabView(tabView: NSTabView, willSelectTabViewItem tabViewItem: NSTabViewItem) {
        super.tabView(tabView, willSelectTabViewItem: tabViewItem)
        
        let currentTabViewItem = tabView.selectedTabViewItem?
        if (currentTabViewItem != nil) {
            currentTabViewItem!.view!.hidden = true
        }
        tabViewItem.view!.hidden = true
        
        // for each tabViewItem, save the original, as-laid-out-in-IB view size, so it can be used to resize the window with the selected tab changes
        var size = (tabViewItem.view?.frame.size)!
        var originalSize = self.originalSizes[tabViewItem.label]
        if (originalSize != nil) {
            size = originalSize!
        } else {
            self.originalSizes[tabViewItem.label] = size
        }
        
        let window = self.view.window
        if (window != nil) {
            window?.title = tabViewItem.label

            var frame = (window?.frame)!
            frame.origin.y = frame.origin.y + (frame.size.height - size.height)
            frame.size.height = size.height;
            frame.size.width = size.width;
            window?.setFrame(frame, display: true, animate: true)
        }
    }
    
    override func tabView(tabView: NSTabView, didSelectTabViewItem tabViewItem: NSTabViewItem) {
{'fraction_non_alphanumeric': 0.08581644815256258, 'fraction_numerical': 0.0, 'mean_word_length': 2.380664652567976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5702684', 'n_tokens_mistral': 954, 'n_tokens_neox': 930, 'n_words': 248}