<commit_before>from __future__ import absolute_import, division, print_function

from ..qtutil import (mpl_to_qt4_color, symbol_icon, POINT_ICONS,
                      qt4_to_mpl_color)

from ...external.qt.QtGui import (QFormLayout, QDialogButtonBox, QColorDialog,
                                  QWidget, QLineEdit, QListWidget,
                                  QListWidgetItem, QPixmap, QDialog, QLabel,
                                  QSpinBox, QComboBox)

from ...external.qt.QtCore import QSize, Signal, Qt


class ColorWidget(QLabel):
    mousePressed = Signal()

    def mousePressEvent(self, event):
        self.mousePressed.emit()
        event.accept()


class StyleDialog(QDialog):

    """Dialog which edits the style of a layer (Data or Subset)

    Use via StyleDialog.edit_style(layer)
    """

    def __init__(self, layer, parent=None, edit_label=True):
        super(StyleDialog, self).__init__(parent)
        self.setWindowTitle("Style Editor")
        self.layer = layer
        self._edit_label = edit_label
        self._symbols = POINT_ICONS.keys()

        self._setup_widgets()
        self._connect()

    def _setup_widgets(self):
        self.layout = QFormLayout()

        self.size_widget = QSpinBox()<commit_msg>Fix style editor in Python 3<commit_after>from __future__ import absolute_import, division, print_function

from ..qtutil import (mpl_to_qt4_color, symbol_icon, POINT_ICONS,
                      qt4_to_mpl_color)

from ...external.qt.QtGui import (QFormLayout, QDialogButtonBox, QColorDialog,
                                  QWidget, QLineEdit, QListWidget,
                                  QListWidgetItem, QPixmap, QDialog, QLabel,
                                  QSpinBox, QComboBox)

from ...external.qt.QtCore import QSize, Signal, Qt


class ColorWidget(QLabel):
    mousePressed = Signal()

    def mousePressEvent(self, event):
        self.mousePressed.emit()
        event.accept()


class StyleDialog(QDialog):

    """Dialog which edits the style of a layer (Data or Subset)

    Use via StyleDialog.edit_style(layer)
    """

    def __init__(self, layer, parent=None, edit_label=True):
        super(StyleDialog, self).__init__(parent)
        self.setWindowTitle("Style Editor")
        self.layer = layer
        self._edit_label = edit_label
        self._symbols = list(POINT_ICONS.keys())

        self._setup_widgets()
        self._connect()

    def _setup_widgets(self):
        self.layout = QFormLayout()

        self.size_widget = QSpinBox()
{'fraction_non_alphanumeric': 0.09022556390977443, 'fraction_numerical': 0.0019786307874950534, 'mean_word_length': 2.407008086253369, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7463416', 'n_tokens_mistral': 770, 'n_tokens_neox': 718, 'n_words': 168}