  import signal
  import sys
  from threading import Thread
  from time import time
  
  import psutil
  
 
</s> remove from subprocess import PIPE, Popen
 </s> add  </s> remove     def calc_elapsed(self):
        """ Calculate and format time since training started """
 </s> add     def _calculate_elapsed(self) -> str:
        """ Calculate and format time since training started

        Returns
        -------
        str
            The amount of time elapsed since training started in HH:mm:ss format
        """ </s> remove     def capture_loss(self, string):
        """ Capture loss values from stdout """
        logger.trace("Capturing loss")
 </s> add     def _capture_loss(self, string: str) -> bool:
        """ Capture loss values from stdout

        Parameters
        ----------
        string: str
            An output line read from stdout

        Returns
        -------
        bool
            ``True`` if a loss line was captured from stdout, otherwise ``False``
        """
        logger.trace("Capturing loss")  # type:ignore[attr-defined] </s> remove         elapsed_time = now - self.train_stats["timestamp"]
 </s> add         timestamp = self._train_stats["timestamp"]
        assert isinstance(timestamp, float)
        elapsed_time = now - timestamp
import typing as T

from subprocess import PIPE, Popen
  import signal
  import sys
import typing as T

from subprocess import PIPE, Popen
  from threading import Thread
  from time import time
  
  import psutil
  
keep add keep keep keep keep keep
 bugfix: GUI force stdout/stderr reading to utf-8 
lib/gui/wrapper.py