<s> """<STR_LIT>""" <EOL> import logging <EOL> import os <EOL> import platform <EOL> import signal <EOL> import sys <EOL> _logger = logging . getLogger ( "<STR_LIT>" ) <EOL> _logger . setLevel ( logging . INFO ) <EOL> _logger . addHandler ( logging . StreamHandler ( sys . stderr ) ) <EOL> def exit_handler ( * args ) : <EOL> """<STR_LIT>""" <EOL> logging . shutdown ( ) <EOL> if platform . system ( ) == '<STR_LIT>' : <EOL> import win32api , win32con <EOL> handle = win32api . OpenProcess ( win32con . PROCESS_TERMINATE , <EOL> <NUM_LIT:0> , os . getpid ( ) ) <EOL> win32api . TerminateProcess ( handle , <NUM_LIT:0> ) <EOL> win32api . CloseHandle ( handle ) <EOL> else : <EOL> os . kill ( os . getpid ( ) , signal . SIGTERM ) <EOL> def keyboard_interrupt_handler ( signo , frame ) : <EOL> _logger . info ( "<STR_LIT>" ) <EOL> exit_handler ( ) <EOL> def wm_delete_window_handler ( ) : <EOL> _logger . info ( "<STR_LIT>" ) <EOL> exit_handler ( ) </s>
