def parse(cls, s):
        """
        Parse a versionstring and return a Version() of it.
        :param s: string to parse
        :type s: str
        :return: a Version() instance describing the parsed string
        :rtype: Version
        """
        if isinstance(s, cls):
            # s is already a Version
            return s
        parsed = _parse_version(s)
        return Version(**parsed)

        Parse a versionstring and return a Version() of it.
        :param s: string to parse
        :type s: str
        :return: a Version() instance describing the parsed string
        :rtype: Version
        
lib/libversion.py