<commit_before>"""IPython View: interactive shell in the interface."""

# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os

import klustaviewa.utils.logger as log

try:
    from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
    from IPython.qt.inprocess import QtInProcessKernelManager
    from IPython.lib import guisupport
    IPYTHON = True
except Exception as e:
    IPYTHON = False
    log.debug(("You need IPython 1.0dev if you want the IPython console in the"
    "application: " + e.message))
    
import galry
from galry import QtGui, QtCore


# -----------------------------------------------------------------------------
# IPython view
# -----------------------------------------------------------------------------
class IPythonView(QtGui.QWidget):
    def __init__(self, parent=None, getfocus=None):
        super(IPythonView, self).__init__(parent)
        
        # Create an in-process kernel
        self.kernel_manager = QtInProcessKernelManager()
        self.kernel_manager.start_kernel()
        self.kernel = self.kernel_manager.kernel
        self.kernel.gui = 'qt4'
        self.shell = self.kernel.shell

        self.kernel_client = self.kernel_manager.client()
        self.kernel_client.start_channels()

        self.control = RichIPythonWidget()
        self.control.set_default_style(colors='linux')
        self.control.kernel_manager = self.kernel_manager
        self.control.kernel_client = self.kernel_client
        self.control.exit_requested.connect(self.stop)
        <commit_msg>IPython 1.0 is out now.<commit_after>"""IPython View: interactive shell in the interface."""

# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os

import klustaviewa.utils.logger as log

try:
    from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
    from IPython.qt.inprocess import QtInProcessKernelManager
    from IPython.lib import guisupport
    IPYTHON = True
except Exception as e:
    IPYTHON = False
    log.debug(("You need IPython 1.0 if you want the IPython console in the"
    "application: " + e.message))
    
import galry
from galry import QtGui, QtCore


# -----------------------------------------------------------------------------
# IPython view
# -----------------------------------------------------------------------------
class IPythonView(QtGui.QWidget):
    def __init__(self, parent=None, getfocus=None):
        super(IPythonView, self).__init__(parent)
        
        # Create an in-process kernel
        self.kernel_manager = QtInProcessKernelManager()
        self.kernel_manager.start_kernel()
        self.kernel = self.kernel_manager.kernel
        self.kernel.gui = 'qt4'
        self.shell = self.kernel.shell

        self.kernel_client = self.kernel_manager.client()
        self.kernel_client.start_channels()

        self.control = RichIPythonWidget()
        self.control.set_default_style(colors='linux')
        self.control.kernel_manager = self.kernel_manager
        self.control.kernel_client = self.kernel_client
        self.control.exit_requested.connect(self.stop)
        
{'fraction_non_alphanumeric': 0.25530642750373694, 'fraction_numerical': 0.002391629297458894, 'mean_word_length': 1.607950116913484, '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': '104314', 'n_tokens_mistral': 853, 'n_tokens_neox': 845, 'n_words': 184}