def is_alive(self):
        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


    # Methods to send specific messages on channels
Is the kernel process still running?
dataset/ETHPy150Open jupyter/jupyter_client/jupyter_client/client.py/KernelClient.is_alive