docstr: Create a thread to run the heartbeat client.
  
  Args:
      heartbeat_server_addr(str): the address of the heartbeat server.
      heartbeat_exit_callback_func(function): A callback function, which will be called after the 
                                              heartbeat exit.
      exit_func_args(tuple): the argument tuple for calling the heartbeat_exit_callback_func. Defaults to ().
      exit_func_kwargs(dict): the argument dict for calling the heartbeat_exit_callback_func. Defaults to {}.
      client_id(str): unique ID of the client.
docstr_tok: ["Create","a","thread","to","run","the","heartbeat","client",".","Args",":","heartbeat_server_addr","(","str",")",":","the","address","of","the","heartbeat","server",".","heartbeat_exit_callback_func","(","function",")",":","A","callback","function",",","which","will","be","called","after","the","heartbeat","exit",".","exit_func_args","(","tuple",")",":","the","argument","tuple","for","calling","the","heartbeat_exit_callback_func",".","Defaults","to","(",")",".","exit_func_kwargs","(","dict",")",":","the","argument","dict","for","calling","the","heartbeat_exit_callback_func",".","Defaults","to","{","}",".","client_id","(","str",")",":","unique","ID","of","the","client","."]
code: def __init__(
      self,
      heartbeat_server_addr,
      heartbeat_exit_callback_func,
      exit_func_args=(),
      exit_func_kwargs={},
      client_id="default",
  ):
      """Create a thread to run the heartbeat client.
  
      Args:
          heartbeat_server_addr(str): the address of the heartbeat server.
          heartbeat_exit_callback_func(function): A callback function, which will be called after the
                                                  heartbeat exit.
          exit_func_args(tuple): the argument tuple for calling the heartbeat_exit_callback_func. Defaults to ().
          exit_func_kwargs(dict): the argument dict for calling the heartbeat_exit_callback_func. Defaults to {}.
          client_id(str): unique ID of the client.
      """
      assert isinstance(heartbeat_server_addr, str)
      assert callable(
          heartbeat_exit_callback_func
      ), "It should be a function."
      assert isinstance(exit_func_args, tuple)
      assert isinstance(exit_func_kwargs, dict)
  
      threading.Thread.__init__(self)
      self.heartbeat_server_addr = heartbeat_server_addr
  
      self.heartbeat_exit_callback_func = heartbeat_exit_callback_func
      self._exit_func_args = exit_func_args
      self._exit_func_kwargs = exit_func_kwargs
  
      self.stop_tag = None
      self.stop_message = None
      self.exit_flag = False
      self.client_id = client_id
  
file_path: PARL/parl/remote/grpc_heartbeat/heartbeat_client.py
imports: import os
  import grpc
  import time
  import threading
  from parl.remote import remote_constants
  from parl.remote.grpc_heartbeat import heartbeat_pb2
  from parl.remote.grpc_heartbeat import heartbeat_pb2_grpc
  from parl.utils import logger
label_desc: Use image node_id 1 to create a new HeartbeatClientThread object from inherited base classes: threading with example: obj = HeartbeatClientThread(heartbeat_server_addr, heartbeat_exit_callback_func, exit_func_args, exit_func_kwargs, client_id)