class_docstr: A simple ping-pong style heartbeat that runs in a thread.
code: def run(self):
      self.socket = self.context.socket(zmq.ROUTER)
      self.socket.linger = 1000
      c = ":" if self.transport == "tcp" else "-"
      self.socket.bind(
          "%s://%s" % (self.transport, self.ip) + c + str(self.port)
      )
      while True:
          try:
              zmq.device(zmq.QUEUE, self.socket, self.socket)
          except zmq.ZMQError as e:
              if e.errno == errno.EINTR:
                  continue
              else:
                  raise
          else:
              break
  
file_path: catboost/contrib/python/ipykernel/py2/ipykernel/heartbeat.py
imports: import errno
  import os
  import socket
  from threading import Thread
  import zmq
  from jupyter_client.localinterfaces import localhost
label_desc: Use image node_id 2 for calling the Heartbeat obj's underlying member method code with example usage: obj.run() without return types