  
              logger.debug("Termination timed out. Killing Process...")
              print("Termination timed out. Killing Process...")
              for child in alive:
                  child.kill()
              _, alive = psutil.wait_procs(alive, timeout=10)
              if not alive:
                  logger.debug("Killed")
                  print("Killed")
              else:
                  for child in alive:
                      msg = "Process {} survived SIGKILL. Giving up".format(child)
                      logger.debug(msg)
                      print(msg)
  
      def set_final_status(self, returncode):
          """ Set the status bar output based on subprocess return code 
              and reset training stats """
          logger.debug("Setting final status. returncode: %s", returncode)
 
</s> remove             logger.debug("Termination timed out. Killing Process...")
            print("Termination timed out. Killing Process...")
 </s> add     @staticmethod
    def terminate_all_children():
        """ Terminates all children """
        logger.debug("Terminating Process...")
        print("Terminating Process...", flush=True)
        children = psutil.Process().children(recursive=True)
        for child in children:
            child.terminate()
        _, alive = psutil.wait_procs(children, timeout=10)
        if not alive:
            logger.debug("Terminated")
            print("Terminated")
            return

        logger.debug("Termination timed out. Killing Process...")
        print("Termination timed out. Killing Process...", flush=True)
        for child in alive:
            child.kill()
        _, alive = psutil.wait_procs(alive, timeout=10)
        if not alive:
            logger.debug("Killed")
            print("Killed")
        else: </s> remove             logger.debug("Terminating Process...")
            print("Terminating Process...")
            children = psutil.Process().children(recursive=True)
            for child in children:
                child.terminate()
            _, alive = psutil.wait_procs(children, timeout=10)
            if not alive:
                logger.debug("Terminated")
                print("Terminated")
                return
 </s> add             self.terminate_all_children() </s> remove             except ValueError as err:
                logger.error("Error terminating process", exc_info=True)
                print(err)
 </s> add  </s> remove                    "updatepreview": updatepreview}
 </s> add                    "updatepreview": updatepreview,
                   "traintimeout": traintimeout} </s> remove                 if os.name == "nt":
                    try:
                        logger.debug("Sending carriage return to process")
                        self.process.communicate(input="\n", timeout=60)
                    except TimeoutExpired:
                        raise ValueError("Timeout reached sending Exit Signal")
                else:
                    logger.debug("Sending SIGINT to process")
                    self.process.send_signal(signal.SIGINT)
                    while True:
                        timeelapsed = time() - now
                        if self.process.poll() is not None:
                            break
                        if timeelapsed > 60:
                            raise ValueError("Timeout reached sending Exit Signal")
 </s> add                 self.process.send_signal(signal.SIGINT)
                while True:
                    timeelapsed = time() - now
                    if self.process.poll() is not None:
                        break
                    if timeelapsed > timeout:
                        logger.error("Timeout reached sending Exit Signal")
                        self.terminate_all_children()
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
  
              logger.debug("Termination timed out. Killing Process...")
              print("Termination timed out. Killing Process...")
              for child in alive:
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
                msg = "Process {} survived SIGKILL. Giving up".format(child)
                logger.debug(msg)
                print(msg)
  
      def set_final_status(self, returncode):
          """ Set the status bar output based on subprocess return code 
              and reset training stats """
          logger.debug("Setting final status. returncode: %s", returncode)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Add timeout slider to train tab. Terminate properly on timeout 
lib/gui/wrapper.py