<commit_before>#!/usr/bin/env python

from PyQt4.QtCore import *
from PyQt4.QtGui import *

class RoomBGImage(QLabel):

    def __init__(self, parent=None):
        super(RoomBGImage, self).__init__(parent)
        self.area_x_start = -1
        self.area_y_start = -1
        self.area_x_stop = -1
        self.area_y_stop = -1
        self.released = False

    def mousePressEvent(self, event):
        if (0 <= event.pos().x() <= self.width()
            and 0 <= event.pos().y() <= self.height()):
            self.area_x_start = event.pos().x()
            self.area_y_start = event.pos().y()
            self.released = False

    def mouseMoveEvent(self, event=None):
        if (event.buttons() and Qt.LeftButton) == Qt.LeftButton:
            if self.area_x_start > -1:
                if(0 <= event.pos().x() <= self.width()
                and 0 <= event.pos().y() <= self.height()):
                    self.area_x_stop = event.pos().x()
                    self.area_y_stop = event.pos().y()
                    self.update()
        else:
            self.released = True
            self.update()

    def mouseReleaseEvent(self, event):
        if self.area_x_start > -1:
            if(0 <= event.pos().x() <= self.width()
            and 0 <= event.pos().y() <= self.height()):
                self.area_x_stop = event.pos().x()
                self.area_y_stop = event.pos().y()
                self.update()
                self.emit(SIGNAL("areaEdited"),
                          self.area_x_start, self.area_y_start,
                          self.area_x_stop, self.area_y_stop)<commit_msg>add self.released on mousereleaseEvent<commit_after>#!/usr/bin/env python

from PyQt4.QtCore import *
from PyQt4.QtGui import *

class RoomBGImage(QLabel):

    def __init__(self, parent=None):
        super(RoomBGImage, self).__init__(parent)
        self.area_x_start = -1
        self.area_y_start = -1
        self.area_x_stop = -1
        self.area_y_stop = -1
        self.released = False

    def mousePressEvent(self, event):
        if (0 <= event.pos().x() <= self.width()
            and 0 <= event.pos().y() <= self.height()):
            self.area_x_start = event.pos().x()
            self.area_y_start = event.pos().y()
            self.released = False

    def mouseMoveEvent(self, event=None):
        if (event.buttons() and Qt.LeftButton) == Qt.LeftButton:
            if self.area_x_start > -1:
                if(0 <= event.pos().x() <= self.width()
                and 0 <= event.pos().y() <= self.height()):
                    self.area_x_stop = event.pos().x()
                    self.area_y_stop = event.pos().y()
                    self.update()
        else:
            self.released = True
            self.update()

    def mouseReleaseEvent(self, event):
        if self.area_x_start > -1:
            if(0 <= event.pos().x() <= self.width()
            and 0 <= event.pos().y() <= self.height()):
                self.area_x_stop = event.pos().x()
                self.area_y_stop = event.pos().y()
                self.released = True
                self.update()
                self.emit(SIGNAL("areaEdited"),
                          self.area_x_start, self.area_y_start,
                          self.area_x_stop, self.area_y_stop)
{'fraction_non_alphanumeric': 0.1437689969604863, 'fraction_numerical': 0.00851063829787234, 'mean_word_length': 1.6561743341404358, 'pattern_counts': {'":': 0, '<': 27, '<?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': '2856634', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1007, 'n_words': 188}