def restart_kernel(self, now=False):
        if self._launch_args is None:
            raise RuntimeError("Cannot restart the kernel. "
                               "No previous call to 'start_kernel'.")
        else:
            if self.has_kernel:
                if now:
                    self.kill_kernel()
                else:
                    self.shutdown_kernel(restart=True)
            self.start_kernel(**self._launch_args)

            # FIXME: Messages get dropped in Windows due to probable ZMQ bug
            # unless there is some delay here.
            if sys.platform == 'win32':
                time.sleep(0.2)
L{Factory.buildProtocol} by default constructs a protocol by calling
dataset/ETHPy150Open ipython/ipython-py3k/IPython/parallel/engine/kernelstarter.py/KernelStarter.restart_kernel--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_protocol.py/FactoryTests.test_defaultBuildProtocol