class_docstr: Manages the status/heartbeat monitor for a set of workers.
class_docstr_tok: ["Manages","the","status\/heartbeat","monitor","for","a","set","of","workers","."]
docstr: Shutdown all workers after `shutdown_timeout_secs`.
docstr_tok: ["Shutdown","all","workers","after","`","shutdown_timeout_secs","`","."]
code: def shutdown(self, wait_time_in_ms=60000, exit_code=0):
      """Shutdown all workers after `shutdown_timeout_secs`."""
      logging.info("Shutting down %s.", self)
      req = event_pb2.WorkerHeartbeatRequest(
          watchdog_config=event_pb2.WatchdogConfig(
              timeout_ms=wait_time_in_ms
          ),
          shutdown_mode=event_pb2.SHUTDOWN_AFTER_TIMEOUT,
          exit_code=event_pb2.RequestedExitCode(exit_code=exit_code),
      )
      self.configure(req)
  
      # Wait for workers to shutdown.
      sleep_sec = 10.0 + wait_time_in_ms / 1000
      logging.info(
          "Waiting %.2f seconds for worker shutdown.", sleep_sec
      )
      time.sleep(sleep_sec)
  
imports: import threading
  import time
  from google.protobuf import text_format
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.util import event_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.tpu.ops import tpu_ops
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training import training_util
label_desc: Use image node_id 8 for calling the WorkerHeartbeatManager obj's underlying member method code with example usage: obj.shutdown(wait_time_in_ms, exit_code) without return types