code: def stop(self):
          
          logger.debug('Stopping kernel')
          self.kc.stop_channels()
          self.km.shutdown_kernel(now=True)
          del self.km
docs: Instructs the kernel process to stop channels
          and the kernel manager to then shutdown the process.