<commit_before># -*- coding: utf-8 -*-
"""
Created on Sat Jul 19 07:53:38 2014

@author: <NAME>
"""
import os.path
import global_vars as g
import numpy as np
import window
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtCore import pyqtSignal as Signal
from PyQt4.QtCore import pyqtSlot  as Slot
import pyqtgraph as pg
import sys
import inspect

__all__ = []

        
class MissingWindowError(Exception):
    def __init__(self, value):
        self.value = value
        g.m.statusBar().showMessage(value)
    def __str__(self):
        return repr(self.value)


class WindowSelector(QWidget):
    """
    This widget is a button with a label.  Once you click the button, the widget waits for you to click a Window object.  Once you do, it sets self.window to be the window, and it sets the label to be the widget name.
    """
    valueChanged=Signal()
    def __init__(self):
        QWidget.__init__(self)
        self.button=QPushButton('Select Window')
        self.button.setCheckable(True)
        self.label=QLabel('None')
        self.window=None
        self.layout=QHBoxLayout()
        self.layout.addWidget(self.button)
        self.layout.addWidget(self.label)
        self.setLayout(self.layout)
        self.button.clicked.connect(self.buttonclicked)
    def buttonclicked(self):
        if self.button.isChecked() is False:
            g.m.setCurrentWindowSignal.sig.disconnect(self.windowSet)
        else:
            g.m.setCurrentWindowSignal.sig.connect(self.windowSet)
    def windowSet(self):
        g.m.setCurrentWindowSignal.sig.disconnect(self.windowSet)
        self.window=g.m.currentWindow
        self.button.setChecked(False)
        self.label.setText('...'+os.path.split(self.window.name)[-1][-20:])
        self.valueChanged.emit()
    def value(self):
        return self.window

<commit_msg>changed windowSet to setWindow<commit_after># -*- coding: utf-8 -*-
"""
Created on Sat Jul 19 07:53:38 2014

@author: <NAME>
"""
import os.path
import global_vars as g
import numpy as np
import window
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtCore import pyqtSignal as Signal
from PyQt4.QtCore import pyqtSlot  as Slot
import pyqtgraph as pg
import sys
import inspect

__all__ = []

        
class MissingWindowError(Exception):
    def __init__(self, value):
        self.value = value
        g.m.statusBar().showMessage(value)
    def __str__(self):
        return repr(self.value)


class WindowSelector(QWidget):
    """
    This widget is a button with a label.  Once you click the button, the widget waits for you to click a Window object.  Once you do, it sets self.window to be the window, and it sets the label to be the widget name.
    """
    valueChanged=Signal()
    def __init__(self):
        QWidget.__init__(self)
        self.button=QPushButton('Select Window')
        self.button.setCheckable(True)
        self.label=QLabel('None')
        self.window=None
        self.layout=QHBoxLayout()
        self.layout.addWidget(self.button)
        self.layout.addWidget(self.label)
        self.setLayout(self.layout)
        self.button.clicked.connect(self.buttonclicked)

    def buttonclicked(self):
        if self.button.isChecked() is False:
            g.m.setCurrentWindowSignal.sig.disconnect(self.setWindow)
        else:
            g.m.setCurrentWindowSignal.sig.connect(self.setWindow)

    def setWindow(self, window=None):
        if window is None:
            try:
                g.m.setCurrentWindowSignal.sig.disconnect(self.setWindow)
            except TypeError:
                pass
            self.window=g.m.currentWindow
        else:
            self.window = window
        self.button.setChecked(False)
        self.label.setText('...'+os.path.split(self.window.name)[-1][-20:])
        self.valueChanged.emit()
    def value(self):
        return self.window


{'fraction_non_alphanumeric': 0.10252447192168986, 'fraction_numerical': 0.010303967027305513, 'mean_word_length': 2.6840607210626186, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3270057', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1163, 'n_words': 299}