Returns True if any of the installed versions match the specified version,
    otherwise returns False
543870
def _fulfills_version_spec(versions, oper, desired_version,
                           ignore_epoch=False):
    '''
    
    '''
    cmp_func = __salt__.get('pkg.version_cmp')
    # stripping "with_origin" dict wrapper
    if salt.utils.platform.is_freebsd():
        if isinstance(versions, dict) and 'version' in versions:
            versions = versions['version']
    for ver in versions:
        if (oper == '==' and fnmatch.fnmatch(ver, desired_version)) \
                or salt.utils.versions.compare(ver1=ver,
                                               oper=oper,
                                               ver2=desired_version,
                                               cmp_func=cmp_func,
                                               ignore_epoch=ignore_epoch):
            return True
    return False
485084
def exact_or_minor_exe_version_match(executable_name,
                                     exe_version_tuples,
                                     version):
    
    exe = exact_exe_version_match(executable_name,
                                  exe_version_tuples,
                                  version)

    if not exe:
        exe = minor_exe_version_match(executable_name,
                                      exe_version_tuples,
                                      version)
    return exe
641953
public Version getHighestMatch(List<Version> versions)
   {
      Version matched = null;
      for (Version version : versions)
      {
         if (includes(version))
         {
            if (matched == null || version.compareTo(matched) > 0)
            {
               matched = version;
            }
         }
      }
      return matched;
   }
66814
def checkSystemVersion(s, versions=None):
    

    if versions is None:
        versions = getSystemVersions()

    currentVersionMap = dict([(v.package, v) for v in versions])
    mostRecentSystemVersion = s.findFirst(SystemVersion,
                                          sort=SystemVersion.creation.descending)
    mostRecentVersionMap = dict([(v.package, v.asVersion()) for v in
                                 s.query(SoftwareVersion,
                                         (SoftwareVersion.systemVersion ==
                                          mostRecentSystemVersion))])

    if mostRecentVersionMap != currentVersionMap:
        currentSystemVersion = SystemVersion(store=s, creation=Time())
        for v in currentVersionMap.itervalues():
            makeSoftwareVersion(s, v, currentSystemVersion)
653463
def find_version_to_install(self, name):
        
        version = Version.parse(name)
        if version.patch is not None:
            return name
        try:
            best_match = max((
                inst_version
                for inst_version in self.iter_installable_versions()
                if inst_version.matches_minor(version)
            ), key=operator.attrgetter('cmpkey'))
        except ValueError:
            raise ValueError(
                'no installable version found for {0!r}'.format(name),
            )
        return best_match
1156560
def find_any_valid_version(self):  # type: () -> str
        
        versions = self.all_current_versions()

        if not versions and not self.force_init:
            raise JiggleVersionException(
                "Have no versions to work with, failed to find any. Include --init to start out at 0.1.0"
            )

        if not versions and self.force_init:
            versions = {"force_init": "0.1.0"}

        if len(versions) > 1:
            if not self.all_versions_equal(versions):
                if not self.all_versions_equal(versions):
                    almost_same = self.almost_the_same_version(
                        [x for x in versions.values()]
                    )
                    if almost_same:
                        # TODO: disable with strict option
                        logger.warning(
                            "Version very by a patch level, will use greater."
                        )
                        return unicode(almost_same)

        if not versions.keys():
            raise JiggleVersionException("Noooo! Must find a value" + unicode(versions))
        return unicode(first_value_in_dict(versions))
772349
function compareVersions(fstVer, sndVer) {
    if (semver.lt(fstVer, sndVer)) {
        return 1;
    }
    if (semver.gt(fstVer, sndVer)) {
        return -1;
    }
    return 0;
}
1166654
def check(self, version):
        

        for disjunct in self._disjuncts:
            if self._check_insersection(version, disjunct):
                return True

        return False
422097
def get_installed_version(self):
        """"""
        if self.check():
            return '%s (%s)' % (self.installed_version, self.OK)
        else:
            return '%s (%s)' % (self.installed_version, self.NOK)
1339181
function compareVersion(version, range) {
        var string = (range + '');
        var n = +(string.match(/\d+/) || NaN);
        var op = string.match(/^[<>]=?|/)[0];
        return comparator[op] ? comparator[op](version, n) : (version == n || n !== n);
    }
245221
def check_compatibility(name):
    

    comp = comp_names[name]

    if sys.version_info.major < 3 and comp.compat == "python3":
        return False

    if sys.version_info.major >= 3 and comp.compat != "python3":
        return False

    return True
751601
function validVersion(version, spec) {
  // Normalize route versions
  var test = spec.versions || [spec.version]

  // Check for direct version match
  if (~test.indexOf(version)) {
    return true
  }

  // Use semver and attempt to match on supplied version
  return !!test.filter(function(v) {
    return semver.satisfies(v, version)
  }).length
}
1083402
function checkIfVersionUpdated() {

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

        return latestBuildNumber === currentBuildNumber;
    }
929947
def is_compatible(self, model, version):
        
        if not model in self.models:
            return False
        if self.max_ykver:
            return (version >= self.min_ykver and
                    version <= self.max_ykver)
        else:
            return version >= self.min_ykver
19091
def check_version(component, expected_version):
    """"""

    comp = comp_names[component]

    compath = os.path.realpath(os.path.abspath(comp.path))
    sys.path.insert(0, compath)

    import version

    if version.version != expected_version:
        raise EnvironmentError("Version mismatch during release, expected={}, found={}".format(expected_version, version.version))
227315
def match(self, version):
        
        if isinstance(version, string_types):
            version = self.version_class(version)
        for operator, constraint, prefix in self._parts:
            f = self._operators.get(operator)
            if isinstance(f, string_types):
                f = getattr(self, f)
            if not f:
                msg = ('%r not implemented '
                       'for %s' % (operator, self.__class__.__name__))
                raise NotImplementedError(msg)
            if not f(version, constraint, prefix):
                return False
        return True
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