<commit_before>import Cocoa

class PopoverWindowController: NSWindowController {

    let popoverController = PopoverController()
    var popoverManager: PopoverManager?
    var popover = NSPopover()

    override func loadWindow() {
        self.window = NSWindow_Popover(contentRect: NSMakeRect(0, 0, 0, 0), styleMask: 1, backing: NSBackingStoreType.Buffered, defer: false)
        self.popoverController.loadView()
        self.popover = self.popoverController.popover

        NSNotificationCenter.defaultCenter().addObserver(self, selector: "windowNeedsToClose", name: NSWindowDidResignMainNotification, object: nil)
        NSNotificationCenter.defaultCenter().addObserver(self, selector: "windowNeedsToClose", name: NSWindowDidResignKeyNotification, object: nil)
    }

    // MARK: Notification handlers

    func windowNeedsToClose() {
        self.popoverManager!.popoverIsActive = false
        self.popover.close()
    }
}
<commit_msg>Done that pretty cool stuff<commit_after>import Cocoa

class PopoverWindowController: NSWindowController {

    let popoverController = PopoverController()
    var popoverManager: PopoverManager?
    var popover = NSPopover()

    override func loadWindow() {
        self.window = NSWindow_Popover(contentRect: NSMakeRect(0, 0, 0, 0), styleMask: 1, backing: NSBackingStoreType.Buffered, defer: false)
        self.popoverController.loadView()
        self.popover = self.popoverController.popover

        NSNotificationCenter.defaultCenter().addObserver(self, selector: "windowNeedsToClose", name: NSWindowDidResignMainNotification, object: nil)
        NSNotificationCenter.defaultCenter().addObserver(self, selector: "windowNeedsToClose", name: NSWindowDidResignKeyNotification, object: nil)
    }

    // MARK: Notification handlers

    func windowNeedsToClose() {
        self.popoverManager!.popoverIsActive = false
        self.window?.makeFirstResponder(nil)
        self.popover.close()
    }
}

{'fraction_non_alphanumeric': 0.09062980030721966, 'fraction_numerical': 0.005120327700972862, 'mean_word_length': 4.281081081081081, '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': '922304', 'n_tokens_mistral': 571, 'n_tokens_neox': 537, 'n_words': 113}