class_docstr: The heartbeat channel which monitors the kernel heartbeat.
  
  Note that the heartbeat channel is paused by default. As long as you start
  this channel, the kernel manager will ensure that it is paused and un-paused
  as appropriate.
class_docstr_tok: ["The","heartbeat","channel","which","monitors","the","kernel","heartbeat",".","Note","that","the","heartbeat","channel","is","paused","by","default",".","As","long","as","you","start","this","channel",",","the","kernel","manager","will","ensure","that","it","is","paused","and","un-paused","as","appropriate","."]
docstr: poll for heartbeat replies until we reach self.time_to_dead.
  
  Ignores interrupts, and returns the result of poll(), which
  will be an empty list if no messages arrived before the timeout,
  or the event tuple if there is a message to receive.
docstr_tok: ["poll","for","heartbeat","replies","until","we","reach","self.time_to_dead",".","Ignores","interrupts",",","and","returns","the","result","of","poll","(",")",",","which","will","be","an","empty","list","if","no","messages","arrived","before","the","timeout",",","or","the","event","tuple","if","there","is","a","message","to","receive","."]
code: def _poll(self, start_time):
      """poll for heartbeat replies until we reach self.time_to_dead.
  
      Ignores interrupts, and returns the result of poll(), which
      will be an empty list if no messages arrived before the timeout,
      or the event tuple if there is a message to receive.
      """
  
      until_dead = self.time_to_dead - (time.time() - start_time)
      # ensure poll at least once
      until_dead = max(until_dead, 1e-3)
      events = []
      while True:
          try:
              events = self.poller.poll(1000 * until_dead)
          except ZMQError as e:
              if e.errno == errno.EINTR:
                  # ignore interrupts during heartbeat
                  # this may never actually happen
                  until_dead = self.time_to_dead - (
                      time.time() - start_time
                  )
                  until_dead = max(until_dead, 1e-3)
                  pass
              else:
                  raise
          except Exception:
              if self._exiting:
                  break
              else:
                  raise
          else:
              break
      return events
  
imports: from __future__ import absolute_import
  import atexit
  import errno
  from threading import Thread, Event
  import time
  import zmq
  from zmq import ZMQError
  from jupyter_client import protocol_version_info
  from .channelsabc import HBChannelABC
label_desc: Use image node_id 4 for calling the HBChannel obj's underlying member method code with example usage: obj._poll(start_time) and returns: events