def run_with_reloader(main_func, extra_files=None, interval=1,
                      error_func=None):
    signal.signal(signal.SIGTERM, lambda *args: sys.exit(0))
    enable_tty_echo()
    if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
        thread.start_new_thread(main_func, ())
        try:
            reloader_loop(extra_files, interval)
        except KeyboardInterrupt:
            return
        except SystemExit:
            mon_list = list(chain(iter_monitor_files(), extra_files or ()))
            sys.stderr.write('%s%r\n' % (_MON_PREFIX, mon_list))
            raise
    try:
        sys.exit(restart_with_reloader(error_func=error_func))
    except __HOLE__:
        pass
dataset/ETHPy150Open mahmoud/clastic/clastic/server.py/run_with_reloader