class_docstr: Encapsulates running threads and processes of a Launchpad Program.
class_docstr_tok: ["Encapsulates","running","threads","and","processes","of","a","Launchpad","Program","."]
docstr: Handles stopping of the runtime by a user.
docstr_tok: ["Handles","stopping","of","the","runtime","by","a","user","."]
code: def _stop_by_user(self):
      """Handles stopping of the runtime by a user."""
      _log_and_print_with_color(
          logging.WARNING,
          "User-requested termination. Asking workers to stop.",
      )
      if self._termination_notice_secs > 0:
          _log_and_print_with_color(
              logging.INFO, "Press CTRL+C to terminate immediately."
          )
      if self._termination_notice_secs >= 0:
          signal.signal(signal.SIGINT, lambda sig, frame: self._kill())
      self._stop()
  
imports: import atexit
  import collections
  from concurrent import futures
  import os
  import signal
  import subprocess
  import sys
  import threading
  import time
  import traceback
  from typing import Optional, Sequence, Text
  from absl import flags
  from absl import logging
  from absl.testing import absltest
  from launchpad import flags
  import psutil
  import termcolor
label_desc: Use image node_id 10 for calling the WorkerManager obj's underlying member method code with example usage: obj._stop_by_user() without return types