How to use the ipykernel.kernelbase.Kernel.__init__ function in ipykernel

To help you get started, we’ve selected a few ipykernel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SimVascular / SimVascular / Externals / Make / 2019.02 / BuildHelpers / Jupyter / site-packages / powershell_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)
        
        # powershell_command env variable is set by the kernel to allow both powershell and pwsh
        # but on python2 we cannot pass it thru env variable, see https://github.com/vors/jupyter-powershell/issues/7
        # TODO(python2): can we pass it somehow differently and still provide user-picked value on python2?
        try:
            powershell_command = environ['powershell_command']
        except:
            powershell_command = get_powershell()

        repl = subprocess_repl.SubprocessRepl([powershell_command, '-noprofile', '-File', '-'])
        self.proxy = powershell_proxy.ReplProxy(repl)
github EDS-APHP / HiveQLKernel / hiveql / kernel.py View on Github external
def __init__(self, **kwargs):
        conf_file = os.path.expanduser(CONFIG_FILE)
        if os.path.isfile(conf_file):
            with open(conf_file, mode='r') as file_hanlde:
                self.conf = json.load(file_hanlde)
        pyhiveconf, sql_req = self.parse_code(code="")

        self.create_conn(**pyhiveconf)

        #if self.last_conn is None:
        #    raise ConnectionNotCreated()

        Kernel.__init__(self, **kwargs)
github SimVascular / SimVascular / BuildWithMake / Release / Jupyter / site-packages / simvascular_tk_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)
        repl = subprocess_repl.SubprocessRepl(['C:\\Program Files\\SimVascular\\SimVascular\\REPLACE_SV_TIMESTAMP\\sv.bat', '-tk', '--'])
        self.proxy = simvascular_tk_proxy.ReplProxy(repl)
github supercoderz / redis_kernel / redis_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)
        self.start_redis(**kwargs)
        self.get_commands()
        self.start_history()
github NII-cloud-operation / Jupyter-LC_wrapper / lc_wrapper / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)

        if 'lc_wrapper_fluentd_host' in os.environ:
            fluentd_host = os.environ['lc_wrapper_fluentd_host']
            fluentd_port = int(os.environ.get('lc_wrapper_fluentd_port', '24224'))
            fluentd_tag = os.environ.get('lc_wrapper_fluentd_tag', 'lc_wrapper')
            self.sender = sender.FluentSender(fluentd_tag,
                                              host=fluentd_host,
                                              port=fluentd_port)
            self.log.info('lc_wrapper: Enabled fluent logger: host=%s, port=%s, tag=%s',
                          fluentd_host, fluentd_port, fluentd_tag)
        else:
            self.sender = None

        self._init_message_handler()
        self.start_ipython_kernel()
github ansible / ansible-jupyter-kernel / ansible_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        start_time = time.time()
        Kernel.__init__(self, **kwargs)

        logger.debug("session %s %s", type(self.session), self.session)
        logger.debug("iopub_socket %s %s", type(self.iopub_socket), self.iopub_socket)

        self.original_iopub_socket = self.iopub_socket

        self.iopub_socket = Splitter([self.original_iopub_socket, self])

        self.shell = self.shell_class.instance(parent=self,
                                               profile_dir=self.profile_dir,
                                               user_ns=self.user_ns,
                                               kernel=self)
        self.shell.displayhook.session = self.session
        self.shell.displayhook.pub_socket = self.iopub_socket
        self.shell.displayhook.topic = self._topic('execute_result')
        self.shell.display_pub.session = self.session
github SimVascular / SimVascular / Externals / Make / 2018.05 / BuildHelpers / Jupyter / site-packages / simvascular_tcl_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)
        repl = subprocess_repl.SubprocessRepl(['C:\\Program Files\\SimVascular\\SimVascular\\2019-02-05\\sv.bat', '-tcl', '--'])
        self.proxy = simvascular_tcl_proxy.ReplProxy(repl)
github SimVascular / SimVascular / Externals / Make / 2019.02 / BuildHelpers / Jupyter / site-packages / cygwin_bash_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)
        repl = subprocess_repl.SubprocessRepl(['C:\\cygwin64\\bin\\bash.exe','-i'])
        self.proxy = cygwin_bash_proxy.ReplProxy(repl)
github SimVascular / SimVascular / BuildWithMake / Release / Jupyter / site-packages / simvascular_tcl_kernel / kernel.py View on Github external
def __init__(self, **kwargs):
        Kernel.__init__(self, **kwargs)
        repl = subprocess_repl.SubprocessRepl(['C:\\Program Files\\SimVascular\\SimVascular\\REPLACE_SV_TIMESTAMP\\sv.bat', '-tcl', '--'])
        self.proxy = simvascular_tcl_proxy.ReplProxy(repl)