当前位置: 首页>>代码示例>>Python>>正文


Python jupyter_client.KernelManager方法代码示例

本文整理汇总了Python中jupyter_client.KernelManager方法的典型用法代码示例。如果您正苦于以下问题:Python jupyter_client.KernelManager方法的具体用法?Python jupyter_client.KernelManager怎么用?Python jupyter_client.KernelManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jupyter_client的用法示例。


在下文中一共展示了jupyter_client.KernelManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start_kernel

# 需要导入模块: import jupyter_client [as 别名]
# 或者: from jupyter_client import KernelManager [as 别名]
def start_kernel(self, name):
        """Start a new kernel"""
        base, ext = os.path.splitext(self.parent.connection_file)
        cf = '{base}-{name}{ext}'.format(
            base=base,
            name=name,
            ext=ext,
        )
        manager = KernelManager(
            kernel_name=name,
            session=self.session,
            context=self.future_context,
            connection_file=cf,
        )
        manager.start_kernel()
        self.kernels[name] = kernel = KernelProxy(
            manager=manager,
            shell_upstream=self.shell_stream)
        self.iosub.connect(kernel.iopub_url)
        return self.kernels[name] 
开发者ID:minrk,项目名称:allthekernels,代码行数:22,代码来源:allthekernels.py

示例2: __init__

# 需要导入模块: import jupyter_client [as 别名]
# 或者: from jupyter_client import KernelManager [as 别名]
def __init__(self, *args, **kwargs):
        super(FormatManager, self).__init__(*args, **kwargs)

        if self._instance is not None:
            raise ValueError("FormatManager is a singleton, access with"
                             " FormatManager.format_manager")

        self._formats = {}
        self._km = KernelManager() 
开发者ID:rossant,项目名称:ipymd,代码行数:11,代码来源:format_manager.py

示例3: __init__

# 需要导入模块: import jupyter_client [as 别名]
# 或者: from jupyter_client import KernelManager [as 别名]
def __init__(
        self,
        timeout: int = 100,
        template_type: TemplateType = TemplateType.FULL
    ):
        """
        Initializes Exporter with default timeout (100 seconds) and template
        (FULL) and handles instantiation of km and ep variables for usage when
        generating NotebookNodes and their outputs.

        Args:
            timeout (int): Amount of time in seconds that a visualization can
            run for before being stopped.
            template_type (TemplateType): Type of template to use when
            generating visualization output.
        """
        self.timeout = timeout
        self.template_type = template_type
        # Create custom KernelManager.
        # This will circumvent issues where kernel is shutdown after
        # preprocessing. Due to the shutdown, latency would be introduced
        # because a kernel must be started per visualization.
        self.km = KernelManager()
        self.km.start_kernel()
        self.ep = ExecutePreprocessor(
            timeout=self.timeout,
            kernel_name='python3',
            allow_errors=True
        ) 
开发者ID:kubeflow,项目名称:pipelines,代码行数:31,代码来源:exporter.py


注:本文中的jupyter_client.KernelManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。