Verify (as semantic versions) if v1 < v2
    Patch versions can be different
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
1083402
function checkIfVersionUpdated() {

        var latestBuildNumber = updateJsonHandler.get("latestBuildNumber"),
            currentBuildNumber = Number(/-([0-9]+)/.exec(brackets.metadata.version)[1]);

        return latestBuildNumber === currentBuildNumber;
    }
424394
def version_is_valid(version_str):
    
    try:
        packaging.version.Version(version_str)
    except packaging.version.InvalidVersion:
        return False
    return True
301053
def iter_installable_versions(self):
        
        for name in self._pyenv('install', '--list').out.splitlines():
            try:
                version = Version.parse(name.strip())
            except ValueError:
                continue
            yield version
1133920
def _find_matching_version(versions, version_pattern):
    
    pattern = fnmatch.translate(version_pattern.replace('x', '*'))
    return next((v for v in versions if re.match(pattern, v)), None)
720038
public boolean versionGreaterOrEqual(int major, int minor, int patch) {
    if (this.majorVersion > major) {
      return true;
    }

    if (this.majorVersion < major) {
      return false;
    }

    /*
     * Major versions are equal, compare minor versions
     */
    if (this.minorVersion > minor) {
      return true;
    }
    if (this.minorVersion < minor) {
      return false;
    }

    //Minor versions are equal, compare patch version.
    return this.patchVersion >= patch;
  }
389895
def _compare_version(self, requirements, support):
        

        for guid in requirements:
            # If we support any of the GUIDs in the guid_set, test if any of
            # the provided versions for the GUID are supported.
            if (guid in support and
                any((detected_version in requirements[guid]) for
                    detected_version in support[guid])):
                return True
1233813
def check_version(mod, required):
    """"""
    vers = tuple(int(v) for v in mod.__version__.split('.')[:3])
    if vers < required:
        req = '.'.join(str(v) for v in required)
        raise ImproperlyConfigured(
            "Module \"%s\" version (%s) must be >= %s." %
            (mod.__name__, mod.__version__, req))
693136
def check_version(version_)
      v = version
      f = false
      if v.kind_of?(Hash) && v.include?("version") &&
          v['version'] >= "#{version_}" then
	f = true
      end

      [f, v['version']]
    end
541399
private static function versionableGreaterThan(Versionable $v1, Versionable $v2)
    {
        if ($v1->getMajor() > $v2->getMajor()) {
            return true;
        }
        if ($v1->getMajor() < $v2->getMajor()) {
            return false;
        }

        if ($v1->getMinor() > $v2->getMinor()) {
            return true;
        }
        if ($v1->getMinor() < $v2->getMinor()) {
            return false;
        }

        if ($v1->getPatch() > $v2->getPatch()) {
            return true;
        }
        if ($v1->getPatch() < $v2->getPatch()) {
            return false;
        }

        return false;
    }
583261
def _check_ver(pyver, op, wanted):
    '''
    
    '''
    pyver = distutils.version.LooseVersion(pyver)
    wanted = distutils.version.LooseVersion(wanted)
    return getattr(operator, '__{}__'.format(op))(pyver, wanted)
7198
function toDrupalMajorVersion(version) {
    var regex = /^(\d+)\.\d+\.[x\d+]/;
    var match = version.match(regex)
    if (match) {
      return match[1] + '.x';
    }

    return version;
  }
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
146834
def version_at_least(version_string, major, minor, micro, patch):
    
    parts = re.match(
        r'^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+).*$',
        version_string,
    )
    for ver, gold in zip(parts.group(1, 2, 3, 4), (major, minor, micro, patch)):
        if int(ver) < int(gold):
            return False
        elif int(ver) > int(gold):
            return True
    return True
358195
def synx_installed?
      match = `#{synx} --version`.match(/Synx (\d+)\.(\d+)\.(\d+)/i)
      if match
        major, minor, patch = match.captures.map { |c| Integer(c) }
        major > 0 || minor > 2 || (minor == 2 && patch > 1)
      else
        false
      end
    end
143751
def is_canonical(version, loosedev=False):  # type: (str, bool) -> bool
    
    if loosedev:
        return loose440re.match(version) is not None
    return pep440re.match(version) is not None
1315566
function installVersion(version) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!INSTALL_VERSIONS_CACHE[version]) return [3 /*break*/, 2];
                    return [4 /*yield*/, INSTALL_VERSIONS_CACHE[version]];
                case 1:
                    _a.sent();
                    return [2 /*return*/, false];
                case 2:
                    INSTALL_VERSIONS_CACHE[version] = _installVersion(version);
                    return [4 /*yield*/, INSTALL_VERSIONS_CACHE[version]];
                case 3:
                    _a.sent();
                    return [2 /*return*/, true];
            }
        });
    });
}