                      self.terminate_all_children()
          else:
              self.terminate_all_children()
  
      @staticmethod
      def terminate_all_children():
          """ Terminates all children """
          logger.debug("Terminating Process...")
          print("Terminating Process...", flush=True)
          children = psutil.Process().children(recursive=True)
 
</s> remove                 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()
                return
 </s> add             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() </s> remove                 try:
                    logger.debug("Sending carriage return to process")
                    self.process.communicate(input="\n", timeout=timeout)
                except TimeoutExpired:
                    logger.error("Timeout reached sending Exit Signal")
                    self.terminate_all_children()
 </s> add                 logger.debug("Sending carriage return to process")
                con_in = win32console.GetStdHandle(  # pylint:disable=c-extension-no-member
                    win32console.STD_INPUT_HANDLE)  # pylint:disable=c-extension-no-member
                keypress = self.generate_windows_keypress("\n")
                con_in.WriteConsoleInput([keypress]) </s> remove                 now = time()
 </s> add  </s> remove         if self.is_gui:
 </s> add         if self.is_gui and os.name != "nt":
    @staticmethod
    def generate_windows_keypress(character):
        """ Generate an 'Enter' keypress to terminate Windows training """
        buf = win32console.PyINPUT_RECORDType(  # pylint:disable=c-extension-no-member
            win32console.KEY_EVENT)  # pylint:disable=c-extension-no-member
        buf.KeyDown = 1
        buf.RepeatCount = 1
        buf.Char = character
        return buf

                      self.terminate_all_children()
          else:
              self.terminate_all_children()
  
    @staticmethod
    def generate_windows_keypress(character):
        """ Generate an 'Enter' keypress to terminate Windows training """
        buf = win32console.PyINPUT_RECORDType(  # pylint:disable=c-extension-no-member
            win32console.KEY_EVENT)  # pylint:disable=c-extension-no-member
        buf.KeyDown = 1
        buf.RepeatCount = 1
        buf.Char = character
        return buf

      @staticmethod
      def terminate_all_children():
          """ Terminates all children """
          logger.debug("Terminating Process...")
          print("Terminating Process...", flush=True)
          children = psutil.Process().children(recursive=True)
keep keep keep add keep keep keep keep keep keep
 Fix Timeout issue when terminating training on Windows 
lib/gui/wrapper.py