class_docstr: A simple ping-pong style heartbeat that runs in a thread.
class_docstr_tok: ["A","simple","ping-pong","style","heartbeat","that","runs","in","a","thread","."]
docstr: Initialize the heartbeat thread.
docstr_tok: ["Initialize","the","heartbeat","thread","."]
code: def __init__(self, context, addr=None):
      """Initialize the heartbeat thread."""
      if addr is None:
          addr = ("tcp", localhost(), 0)
      Thread.__init__(self, name="Heartbeat")
      self.context = context
      self.transport, self.ip, self.port = addr
      self.original_port = self.port
      if self.original_port == 0:
          self.pick_port()
      self.addr = (self.ip, self.port)
      self.daemon = True
      self.pydev_do_not_trace = True
      self.is_pydev_daemon_thread = True
      self.name = "Heartbeat"
  
file_path: catboost/contrib/python/ipykernel/py3/ipykernel/heartbeat.py
imports: import errno
  import socket
  from pathlib import Path
  from threading import Thread
  import zmq
  from jupyter_client.localinterfaces import localhost
label_desc: Use image node_id 1 to create a new Heartbeat object from inherited base classes: Thread with example: obj = Heartbeat(context, addr)