          retval = "Exception occured trying to retrieve sysinfo: {}".format(err)
      return retval
  
  
  class _Configs():
      """ Parses the config files in /faceswap/config and outputs the information stored within them
      in a human readable format. """
  
      def __init__(self):
          self.config_dir = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "config")
 
</s> remove class _State():
 </s> add class _State():  # pylint:disable=too-few-public-methods </s> remove             return retval
        return "{}.{}.{}".format(major, minor, patchlevel)

    @staticmethod
    def _cudnn_checkfiles_linux():
        """ Obtain the location of the files to check for cuDNN location in Linux.

        Returns
        str:
            The location of the header files for cuDNN
        """
        chk = os.popen("ldconfig -p | grep -P \"libcudnn.so.\\d+\" | head -n 1").read()
        if "libcudnn.so." not in chk:
            return list()
        chk = chk.strip().replace("libcudnn.so.", "")
        cudnn_vers = chk[0]
        cudnn_path = chk[chk.find("=>") + 3:chk.find("libcudnn") - 1]
        cudnn_path = cudnn_path.replace("lib", "include")
        cudnn_checkfiles = [os.path.join(cudnn_path, "cudnn_v{}.h".format(cudnn_vers)),
                            os.path.join(cudnn_path, "cudnn.h")]
        return cudnn_checkfiles

    def _cudnn_checkfiles_windows(self):
        """ Obtain the location of the files to check for cuDNN location in Windows.

        Returns
        str:
            The location of the header files for cuDNN
        """
        # TODO A more reliable way of getting the windows location
        if not self._cuda_path and not self._cuda_keys_windows:
            return list()
        if not self._cuda_path:
            self._cuda_path = os.environ[self._cuda_keys_windows[0]]

        cudnn_checkfile = os.path.join(self._cuda_path, "include", "cudnn.h")
        return [cudnn_checkfile]

    def _get_cuda_path(self):
        """ Obtain the path to Cuda install location.

        Returns
        -------
        str
            The path to the install location of Cuda on the system
        """
        if self._is_linux:
            path = self._cuda_path_linux()
        elif self._is_windows:
            path = self._cuda_path_windows()
        else:
            path = None
        return path

    @staticmethod
    def _cuda_path_linux():
        """ Obtain the path to Cuda install location on Linux.

        Returns
        -------
        str
            The path to the install location of Cuda on a Linux system
        """
        ld_library_path = os.environ.get("LD_LIBRARY_PATH", None)
        chk = os.popen("ldconfig -p | grep -P \"libcudart.so.\\d+.\\d+\" | head -n 1").read()
        if ld_library_path and not chk:
            paths = ld_library_path.split(":")
            for path in paths:
                chk = os.popen("ls {} | grep -P -o \"libcudart.so.\\d+.\\d+\" | "
                               "head -n 1".format(path)).read()
                if chk:
                    break
        if not chk:
            return None
        return chk[chk.find("=>") + 3:chk.find("targets") - 1]

    @staticmethod
    def _cuda_path_windows():
        """ Obtain the path to Cuda install location on Windows.

        Returns
        -------
        str
            The path to the install location of Cuda on a Windows system
        """
        cuda_path = os.environ.get("CUDA_PATH", None)
        return cuda_path

    def _cuda_version_linux(self):
        """ Obtain the installed version of Cuda on a Linux system.

        Returns
        -------
        The installed CUDA version on a Linux system
        """
        ld_library_path = os.environ.get("LD_LIBRARY_PATH", None)
        chk = os.popen("ldconfig -p | grep -P \"libcudart.so.\\d+.\\d+\" | head -n 1").read()
        if ld_library_path and not chk:
            paths = ld_library_path.split(":")
            for path in paths:
                chk = os.popen("ls {} | grep -P -o \"libcudart.so.\\d+.\\d+\" | "
                               "head -n 1".format(path)).read()
                if chk:
                    break
        if not chk:
            retval = "No global version found"
            if self._is_conda:
                retval += ". Check Conda packages for Conda Cuda"
            return retval
        cudavers = chk.strip().replace("libcudart.so.", "")
        return cudavers[:cudavers.find(" ")]

    def _cuda_version_windows(self):
        """ Obtain the installed version of Cuda on a Windows system.

        Returns
        -------
        The installed CUDA version on a Windows system
        """
        cuda_keys = self._cuda_keys_windows
        if not cuda_keys:
            retval = "No global version found"
            if self._is_conda:
                retval += ". Check Conda packages for Conda Cuda"
            return retval
        cudavers = [key.lower().replace("cuda_path_v", "").replace("_", ".") for key in cuda_keys]
        return " ".join(cudavers)
 </s> add         return retval </s> remove class _SysInfo():
 </s> add class _SysInfo():  # pylint:disable=too-few-public-methods </s> remove     def cuda_check(self):
        """ Check Cuda for Linux or Windows """
 </s> add class CudaCheck():  # pylint:disable=too-few-public-methods
    """ Find the location of system installed Cuda and cuDNN on Windows and Linux. """

    def __init__(self):
        self.cuda_path = None
        self.cuda_version = None
        self.cudnn_version = None

        self._os = platform.system().lower()
        self._cuda_keys = [key for key in os.environ if key.lower().startswith("cuda_path_v")]
        self._cudnn_header_files = ["cudnn_version.h", "cudnn.h"]

        if self._os in ("windows", "linux"):
            self._cuda_check()
            self._cudnn_check()

    def _cuda_check(self):
        """ Obtain the location and version of Cuda and populate :attr:`cuda_version` and
        :attr:`cuda_path`

        Initially just calls `nvcc -V` to get the installed version of Cuda currently in use.
        If this fails, drills down to more OS specific checking methods.
        """ </s> remove             return
 </s> add             return None
class _Configs():  # pylint:disable=too-few-public-methods
          retval = "Exception occured trying to retrieve sysinfo: {}".format(err)
      return retval
  
  
class _Configs():  # pylint:disable=too-few-public-methods
      """ Parses the config files in /faceswap/config and outputs the information stored within them
      in a human readable format. """
  
      def __init__(self):
          self.config_dir = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "config")
keep keep keep keep replace keep keep keep keep keep
 sysinfo/setup - Standardize cuda/cudnn checks 
lib/sysinfo.py