class_docstr: Heartbeat controls the userspace trial state updates.
  
  For unmanaged / detached trials, this class will report the state changes
  to the determined-master.
  
  For managed trials, it'll not do anything as the state is controlled by
  determined-master itself.
code: def __init__(self, *, session: api.Session, trial_id: int) -> None:
      self._session = session
      self._trial_id = trial_id
  
imports: import atexit
  import logging
  import sys
  import threading
  import time
  import types
  from typing import Any, Optional, Union
  from determined.common import api
  from determined.common.api import bindings
label_desc: Use image node_id 1 to create a new _Heartbeat object  with example: obj = _Heartbeat()