code: def __handler(self, sig, frame):
      # Pass second interrupt without delaying
      if self.__signal_received is not None:
          logger.log(
              "\nSIGINT received twice. Stopping...", Text.danger
          )
          self.old_handler(*self.__signal_received)
          return
  
      if self.__is_loop_on_interrupt:
          # Store the interrupt signal for later
          self.__signal_received = (sig, frame)
          logger.log(
              "\nSIGINT received. Delaying KeyboardInterrupt.",
              Text.danger,
          )
      else:
          self.__finish()
          logger.log("Killing loop...", Text.danger)
          self.old_handler(sig, frame)
  
imports: import signal
  import typing
  from typing import Optional, Tuple, Any, Collection
  from labml import tracker, logger, experiment, monit
  from labml.configs import BaseConfigs, meta_config, option
  from labml.internal.monitor import Loop
  from labml.logger import Text
label_desc: Use image node_id 6 for calling the TrainingLoop obj's underlying member method code with example usage: obj.__handler(sig, frame) without return types