Return the lower supported protocol version. Beta versions are omitted.
10439
def get_lower_supported(cls, previous_version):
        
        try:
            version = next(v for v in sorted(ProtocolVersion.SUPPORTED_VERSIONS, reverse=True) if
                           v not in ProtocolVersion.BETA_VERSIONS and v < previous_version)
        except StopIteration:
            version = 0

        return version
491092
def semver_newer(v1, v2):
    
    v1_parts = v1.split('.')
    v2_parts = v2.split('.')
    if len(v1_parts) < 3 or len(v2_parts) < 3:
        # one isn't a semantic version
        return False

    v1_major, v1_minor, v1_patch = get_version_parts(v1_parts, int)
    v2_major, v2_minor, v2_patch = get_version_parts(v2_parts, int)

    if v1_major > v2_major:
        return False

    if v1_major == v2_major and v1_minor >= v2_minor:
        return False

    return True
1200153
def get_version():
        """"""
        cmd = [PostgresFinder.find_root() / 'pg_ctl', '--version']
        results = subprocess.check_output(cmd).decode('utf-8')
        match = re.search(r'(\d+\.\d+(\.\d+)?)', results)
        if match:
            ver_string = match.group(0)
            return tuple(int(x) for x in ver_string.split('.'))
304752
def check_version(self, check, timeout=None, metadata=None,
                      credentials=None):
        """"""
        return self.stub.CheckVersion(check, timeout=timeout,
                                      metadata=metadata,
                                      credentials=credentials)
1310842
def version(which="num"):
    """"""
    if which in VERSIONS:
        return VERSIONS[which]
    else:
        raise CoconutException(
            "invalid version type " + ascii(which),
            extra="valid versions are " + ", ".join(VERSIONS),
        )
143310
def common_wire_version(self):
        """"""
        servers = self.known_servers
        if servers:
            return min(s.max_wire_version for s in self.known_servers)

        return None
1071449
def pg_version(using=None):
    
    connection = get_connection(using)
    cursor = connection.cursor()

    cursor.execute('SHOW server_version')
    row = cursor.fetchone()

    return tuple([int(i) for i in row[0].split('.')])
894582
async def update_version(self):
        """"""
        get_version = GetVersion(pyvlx=self)
        await get_version.do_api_call()
        if not get_version.success:
            raise PyVLXException("Unable to retrieve version")
        self.version = get_version.version
        get_protocol_version = GetProtocolVersion(pyvlx=self)
        await get_protocol_version.do_api_call()
        if not get_protocol_version.success:
            raise PyVLXException("Unable to retrieve protocol version")
        self.protocol_version = get_protocol_version.version
        PYVLXLOG.warning(
            "Connected to: %s, protocol version: %s",
            self.version, self.protocol_version)
995449
def get_version():
    """"""
    _release = get_release()
    split_version = _release.split(".")
    if len(split_version) == 3:
        return ".".join(split_version[:2])
    return _release
680744
def get_default_ssl_version():
    
    if hasattr(ssl, 'PROTOCOL_TLSv1_2'):
        return ssl.PROTOCOL_TLSv1_2
    elif hasattr(ssl, 'PROTOCOL_TLSv1_1'):
        return ssl.PROTOCOL_TLSv1_1
    elif hasattr(ssl, 'PROTOCOL_TLSv1'):
        return ssl.PROTOCOL_TLSv1
    return None
1173743
def version(hostname, timeout=20, username=None, password=None):
    '''
    
    '''
    return __version(__connect(hostname, timeout, username, password))
441014
def get(version: str) -> 'Protocol':
        

        return Protocol.V_13 if version == Protocol.V_13.value.name else Protocol.DEFAULT
1142856
def match_version(desired, available, cmp_func=None, ignore_epoch=False):
    '''
    
    '''
    oper, version = split_comparison(desired)
    if not oper:
        oper = '=='
    for candidate in available:
        if salt.utils.versions.compare(ver1=candidate,
                                       oper=oper,
                                       ver2=version,
                                       cmp_func=cmp_func,
                                       ignore_epoch=ignore_epoch):
            return candidate
    return None
195612
def readProtocolVersion(self, data):
        
        data.readType(self._version)
        if not self._version.value in [ProtocolVersion.RFB003003, ProtocolVersion.RFB003007, ProtocolVersion.RFB003008]:
            self._version.value = ProtocolVersion.UNKNOWN
715262
def inform_version_connect(self, msg):
        """"""
        if len(msg.arguments) < 2:
            return
        # Store version information.
        name = msg.arguments[0]
        self.versions[name] = tuple(msg.arguments[1:])
        if msg.arguments[0] == "katcp-protocol":
            protocol_flags = ProtocolFlags.parse_version(msg.arguments[1])
            self._set_protocol_from_inform(protocol_flags, msg)
1223051
def get_version(release_level=True):
    
    vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__]
    if release_level and __version_info__['releaselevel'] != 'final':
        vers.append('%(releaselevel)s%(serial)i' % __version_info__)
    return ''.join(vers)
171705
def version(self):
        
        return dict(
            buttersink=theVersion,
            btrfs=self.butterStore.butter.btrfsVersion,
            linux=platform.platform(),
        )