class_docstr: Communicates with a single kernel on any host via zmq channels.
  
  There are four channels associated with each kernel:
  
  * shell: for request/reply calls to the kernel.
  * iopub: for the kernel to publish results to frontends.
  * hb: for monitoring the kernel's heartbeat.
  * stdin: for frontends to reply to raw_input calls in the kernel.
  
  The messages that can be sent on these channels are exposed as methods of the
  client (KernelClient.execute, complete, history, etc.). These methods only
  send the message, they don't wait for a reply. To get results, use e.g.
  :meth:`get_shell_msg` to fetch messages from the shell channel.
class_docstr_tok: ["Communicates","with","a","single","kernel","on","any","host","via","zmq","channels",".","There","are","four","channels","associated","with","each","kernel",":","*","shell",":","for","request\/reply","calls","to","the","kernel",".","*","iopub",":","for","the","kernel","to","publish","results","to","frontends",".","*","hb",":","for","monitoring","the","kernel","'s","heartbeat",".","*","stdin",":","for","frontends","to","reply","to","raw_input","calls","in","the","kernel",".","The","messages","that","can","be","sent","on","these","channels","are","exposed","as","methods","of","the","client","(","KernelClient.execute",",","complete",",","history",",","etc.",")",".","These","methods","only","send","the","message",",","they","do","n't","wait","for","a","reply",".","To","get","results",",","use","e.g",".",":","meth",":","`","get_shell_msg","`","to","fetch","messages","from","the","shell","channel","."]
docstr: Is the kernel process still running?
docstr_tok: ["Is","the","kernel","process","still","running","?"]
code: def is_alive(self):
      """Is the kernel process still running?"""
      from .manager import KernelManager
  
      if isinstance(self.parent, KernelManager):
          # This KernelClient was created by a KernelManager,
          # we can ask the parent KernelManager:
          return self.parent.is_alive()
      if self._hb_channel is not None:
          # We don't have access to the KernelManager,
          # so we use the heartbeat.
          return self._hb_channel.is_beating()
      else:
          # no heartbeat and not local, we can't tell if it's running,
          # so naively return True
          return True
  
imports: from __future__ import absolute_import
  from jupyter_client.channels import major_protocol_version
  from ipython_genutils.py3compat import string_types, iteritems
  import zmq
  from traitlets import Any, Instance, Type
  from .channelsabc import ChannelABC, HBChannelABC
  from .clientabc import KernelClientABC
  from .connect import ConnectionFileMixin
label_desc: Use image node_id 12 for calling the KernelClient obj's underlying member method code with example usage: obj.is_alive() and returns: self, self, True