code: def _logfile_sigterm_handler(*_):
      # type: (...) -> None
      
      logging.error('Received SIGTERM.')
      write_logfile()
      print('Received signal. Please see the log file for more information.',
            file=sys.stderr)
      sys.exit(signal)
docs: Handle exit signals and write out a log file.
  
      Raises:
          SystemExit: Contains the signal as the return code.