  def safe_shutdown(got_error=False):
      """ Close queues, threads and processes in event of crash """
      logger = logging.getLogger(__name__)  # pylint:disable=invalid-name
      logger.debug("Safely shutting down")
      from lib.queue_manager import queue_manager
      queue_manager.terminate_queues()
      logger.debug("Cleanup complete. Shutting down queue manager and exiting")
      exit(1 if got_error else 0)
  
  
 
</s> remove     exit(1 if got_error else 0)
 </s> add     sys.exit(1 if got_error else 0) </s> remove     from lib.logger import get_loglevel
 </s> add     from lib.logger import get_loglevel  # pylint:disable=import-outside-toplevel </s> remove from lib.utils import FaceswapError, get_folder, get_image_paths
 </s> add from lib.utils import FaceswapError, get_backend, get_folder, get_image_paths </s> remove         self.logger = None
        if log:
            # Logger is held internally, as we don't want to log
            # when obtaining system stats on crash
            self.logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
            self.logger.debug("Initializing %s", self.__class__.__name__)

        self.plaid = None
        self.initialized = False
        self.device_count = 0
        self.active_devices = list()
        self.handles = list()
        self.driver = None
        self.devices = list()
        self.vram = None

        self.initialize(log)

        self.driver = self.get_driver()
        self.devices = self.get_devices()
        self.vram = self.get_vram()
        if not self.active_devices:
            if self.logger:
                self.logger.warning("No GPU detected. Switching to CPU mode")
 </s> add         # Logger is held internally, as we don't want to log when obtaining system stats on crash
        self._logger = logging.getLogger(__name__) if log else None
        self._log("debug", "Initializing {}".format(self.__class__.__name__))

        self._plaid = None
        self._initialized = False
        self._device_count = 0
        self._active_devices = list()
        self._handles = list()
        self._driver = None
        self._devices = list()
        self._vram = None

        self._initialize(log)

        self._driver = self._get_driver()
        self._devices = self._get_devices()
        self._vram = self._get_vram()
        if not self._active_devices:
            self._log("warning", "No GPU detected. Switching to CPU mode") </s> remove class SysInfo():
    """ System and Python Information """
    # pylint: disable=too-many-instance-attributes,too-many-public-methods

 </s> add class _SysInfo():
    """ Obtain information about the System, Python and GPU """
    from lib.queue_manager import queue_manager  # pylint:disable=import-outside-toplevel
  def safe_shutdown(got_error=False):
      """ Close queues, threads and processes in event of crash """
      logger = logging.getLogger(__name__)  # pylint:disable=invalid-name
      logger.debug("Safely shutting down")
    from lib.queue_manager import queue_manager  # pylint:disable=import-outside-toplevel
      queue_manager.terminate_queues()
      logger.debug("Cleanup complete. Shutting down queue manager and exiting")
      exit(1 if got_error else 0)
  
  
keep keep keep keep replace keep keep keep keep keep
 Core Updates (#1015)

- Remove lib.utils.keras_backend_quiet and replace with get_backend() where relevant
- Document lib.gpu_stats and lib.sys_info
- Remove call to GPUStats.is_plaidml from convert and replace with get_backend()
- lib.gui.menu - typofix 
lib/utils.py