code: def _set_exit_handlers(cls):
      if not cls._are_exit_listeners_set:
          cls._are_exit_listeners_set = True
          # cls._original_sigint_handler = signal.getsignal(signal.SIGINT)
          cls._original_sigterm_handler = signal.getsignal(
              signal.SIGTERM
          )
  
          atexit.register(cls._close_sessions)
          # signal.signal(signal.SIGINT, cls._close_sessions)
          signal.signal(signal.SIGTERM, cls._close_sessions)
  
imports: import os
  import atexit
  import signal
  import threading
  from typing import Optional
  from aim.ext.exception_resistant import exception_resistant
  from aim.sdk.legacy.deprecation_warning import deprecated
  from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT
  from aim.ext.resource.tracker import ResourceTracker
  from aim.sdk.repo import Repo
  from aim.sdk.run import Run
label_desc: Use image node_id 9 for calling the Session obj's underlying member method code with example usage: obj._set_exit_handlers(cls) without return types