Returns True if using GnuPG version 1.x.

    :param tuple version: A tuple of three integers indication major, minor,
        and micro version numbers.
333009
def _is_gpg1(version):
    
    (major, minor, micro) = _match_version_string(version)
    if major == 1:
        return True
    return False
371557
def sys_version(version_tuple):
    

    old_version = sys.version_info
    sys.version_info = version_tuple
    yield
    sys.version_info = old_version
1051805
function isOfMinimumVersion(version, minimumVersion) {
                if (version == null || minimumVersion == null) {
                    return false;
                }
                else if (version == null) {
                    return true;
                }
                var actualVersionPieces = ("" + version).split("."),
                    pieces = minimumVersion.split("."),
                    numberOfPieces = pieces.length;
    
                for (var i = 0; i < numberOfPieces; i++) {
                    var piece = parseInt(pieces[i], 10),
                        actualPiece = parseInt(actualVersionPieces[i], 10);
    
                    if (typeof actualPiece === "undefined") {
                        break;
                    }
                    else if (actualPiece > piece) {
                        break;
                    }
                    else if (actualPiece === piece) {
                        continue;
                    }
                    else {
                        return false;
                    }
                }
    
                return true;
            }
635512
def _sane_version_list(version):
    
    v0 = str(version[0])
    if v0:
        # Test if the major is a number.
        try:
            v0 = v0.lstrip("v").lstrip("V")
            # Handle the common case where tags have v before major.
            v0 = int(v0)
        except ValueError:
            v0 = None

    if v0 is None:
        version = [0, 0] + version
    else:
        version[0] = v0

    try:
        # Test if the minor is a number.
        version[1] = int(version[1])
    except ValueError:
        # Insert Minor 0.
        version = [version[0], 0] + version[1:]

    return version
153227
def is_required_version(version, specified_version):
    
    # Certain packages may be defined with multiple values.
    if isinstance(specified_version, dict):
        specified_version = specified_version.get("version", "")
    if specified_version.startswith("=="):
        return version.strip() == specified_version.split("==")[1].strip()

    return True
1045487
def _check_ubridge_version(self, env=None):
        
        try:
            output = yield from subprocess_check_output(self._path, "-v", cwd=self._working_dir, env=env)
            match = re.search("ubridge version ([0-9a-z\.]+)", output)
            if match:
                self._version = match.group(1)
                if sys.platform.startswith("win") or sys.platform.startswith("darwin"):
                    minimum_required_version = "0.9.12"
                else:
                    # uBridge version 0.9.14 is required for packet filters 
                    # to work for IOU nodes.
                    minimum_required_version = "0.9.14"
                if parse_version(self._version) < parse_version(minimum_required_version):
                    raise UbridgeError("uBridge executable version must be >= {}".format(minimum_required_version))
            else:
                raise UbridgeError("Could not determine uBridge version for {}".format(self._path))
        except (OSError, subprocess.SubprocessError) as e:
            raise UbridgeError("Error while looking for uBridge version: {}".format(e))
1346715
def cmp(cls, v1: 'VersionBase', v2: 'VersionBase') -> int:
        
        # TODO types checking
        if v1._version > v2._version:
            return 1
        elif v1._version == v2._version:
            return 0
        else:
            return -1
1340990
def EnsurePythonVersion(self, major, minor):
        """"""
        if sys.version_info < (major, minor):
            v = sys.version.split()[0]
            print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v))
            sys.exit(2)
885269
def is_tuple(type_: Type[Any]) -> bool:
    '''
    
    '''
    if HAS_TUPLEARGS:
        # The tuple, Tuple thing is a difference between 3.6 and 3.7
        # In 3.6 and before, Tuple had an __extra__ field, while Tuple[something]
        # would have the normal __origin__ field.
        #
        # Those apply for Dict, List, Set, Tuple
        return _generic_type_check(type_, tuple, Tuple)
    else:
        # Old python
        return _issubclass(type_, Tuple) and _issubclass(type_, tuple) == False
328610
def _check_sane_and_get_gpg_version(self):
        
        proc = self._open_subprocess(["--list-config", "--with-colons"])
        result = self._result_map['list'](self)
        self._read_data(proc.stdout, result)
        if proc.returncode:
            raise RuntimeError("Error invoking gpg: %s" % result.data)
        else:
            try:
                proc.terminate()
            except OSError:
                log.error(("Could neither invoke nor terminate a gpg process... "
                           "Are you sure you specified the corrent (and full) "
                           "path to the gpg binary?"))

        version_line = result.data.partition(b':version:')[2].decode()
        if not version_line:
            raise RuntimeError("Got invalid version line from gpg: %s\n" % result.data)
        self.binary_version = version_line.split('\n')[0]
        if not _VERSION_RE.match(self.binary_version):
            raise RuntimeError("Got invalid version line from gpg: %s\n" % self.binary_version)
        log.debug("Using GnuPG version %s" % self.binary_version)
437235
def get_version_id(protocol_version):
    
    ver = registry.version_info.get(protocol_version)
    if ver:
        return ver.version_id
478300
def _check_version(self, config):
        
        try:
            self.file_version = config.get(
                escape_for_ini('keyring-setting'),
                escape_for_ini('version'),
            )
        except (configparser.NoSectionError, configparser.NoOptionError):
            return False
        return True
993699
public function isGitMinimumVersionSatisfied($minimum_version) {
    exec("git --version | cut -d' ' -f3", $output, $exit_code);
    if (version_compare($output[0], $minimum_version, '>=')) {
      return TRUE;
    }
    return FALSE;
  }
757132
def verify_gpg_version():
    """"""
    existing_gpg = keyring.gpg_version().decode('ascii')
    required_gpg = '>=2.1.11'
    msg = 'Existing GnuPG has version "{}" ({} required)'.format(existing_gpg,
                                                                 required_gpg)
    if not semver.match(existing_gpg, required_gpg):
        log.error(msg)
1126715
def get_version(version_tuple):
    """"""
    if version_tuple[3] == FINAL and version_tuple[4] != 0:
        raise Exception(
            'Project version number misconfigured:\n'
            '   version may not be final and have segment number.')

    if version_tuple[3] not in (DEV, FINAL) and version_tuple[4] == 0:
        raise Exception(
            'Project version number misconfigured:\n'
            '   version must have segment number.')

    if version_tuple[3] == DEV:
        segment_num = get_git_changeset()
    else:
        segment_num = str(abs(version_tuple[4]))

    # X.X.X
    sem_ver = ".".join([
        str(abs(int(number)))
        for number in version_tuple[:3]
    ])

    if version_tuple[3] != FINAL:
        if version_tuple[3] in (ALPHA, BETA, RC):
            sem_ver = "%s%s%s" % (sem_ver, version_tuple[3], segment_num)
        elif version_tuple[3] in (DEV, POST):
            sem_ver = "%s%s%s%s" % (
                sem_ver, SEPARATOR, version_tuple[3], segment_num)
        else:
            raise Exception(
                'Project version number misconfigured:\n'
                '   Unrecognized release type')

    return sem_ver
904140
def get_minor_version(module_ident, plpy):
    """"""
    # Make sure to always return the max minor version that is already in the
    # database, in case the given module_ident is not the latest version
    plan = plpy.prepare('''\
        WITH t AS (
            SELECT uuid, major_version
                FROM modules
                WHERE module_ident = $1
        )
        SELECT MAX(m.minor_version) AS minor_version
            FROM modules m, t
            WHERE m.uuid = t.uuid AND m.major_version = t.major_version
        ''', ('integer',))
    results = plpy.execute(plan, (module_ident,), 1)
    return results[0]['minor_version']
648329
def ssh_version():
    '''
    
    '''
    # This function needs more granular checks and to be validated against
    # older versions of ssh
    ret = subprocess.Popen(
            ['ssh', '-V'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE).communicate()
    try:
        version_parts = ret[1].split(b',')[0].split(b'_')[1]
        parts = []
        for part in version_parts:
            try:
                parts.append(int(part))
            except ValueError:
                return tuple(parts)
        return tuple(parts)
    except IndexError:
        return (2, 0)