Returns True if version is contained in this range.
422580
def contains_version(self, version):
        """"""
        if len(self.bounds) < 5:
            # not worth overhead of binary search
            for bound in self.bounds:
                i = bound.version_containment(version)
                if i == 0:
                    return True
                if i == -1:
                    return False
        else:
            _, contains = self._contains_version(version)
            return contains

        return False
881775
public static Version getStrictVersion(Collection<? extends VersionRangeCollection> ranges)
    {
        for (VersionRangeCollection collection : ranges) {
            if (collection.getRanges().size() == 1) {
                VersionRange range = collection.getRanges().iterator().next();
                if (range instanceof DefaultVersionRange) {
                    DefaultVersionRange defaultRange = (DefaultVersionRange) range;
                    Version lowerBound = defaultRange.getLowerBound();
                    if (lowerBound != null && (lowerBound.equals(defaultRange.getUpperBound()))) {
                        return lowerBound;
                    }
                }
            }
        }

        return null;
    }
580788
def is_valid_release_version(version):
    ''''''
    return version is not None and len(version) == 6 and version[0] == 'R' \
            and int(version[1:5]) in range(1990, 2050) \
            and version[5] in ('h', 'g', 'f', 'e', 'd', 'c', 'b', 'a')
926808
def check_version(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    if not value and ctx.invoked_subcommand != 'run':
        ctx.call_on_close(_check_version)
69902
def select_version(self, version_range):
        
        row = -1
        version = None
        for i, package in self.packages.iteritems():
            if package.version in version_range \
                    and (version is None or version < package.version):
                version = package.version
                row = i

        self.clearSelection()
        if row != -1:
            self.selectRow(row)
        return version
513330
function isVersionAtLeast(dottedVersion, major, minor, patch){
	var i, v, t,
		verParts = $.map($.trim(dottedVersion).split("."), function(e){ return parseInt(e, 10); }),
		testParts = $.map(Array.prototype.slice.call(arguments, 1), function(e){ return parseInt(e, 10); });

	for( i = 0; i < testParts.length; i++ ){
		v = verParts[i] || 0;
		t = testParts[i] || 0;
		if( v !== t ){
			return ( v > t );
		}
	}
	return true;
}
1325470
public boolean containsGreaterThan( VersionID m )
    {
        for ( Object _versionId : _versionIds )
        {
            VersionID vi = (VersionID) _versionId;
            boolean check = vi.isGreaterThan( m );
            if ( check )
            {
                return true;
            }
        }
        return false;
    }
177377
static boolean isNewerVersion(String version, String newestVersion, boolean isEarlyAccess) {

        if (version == null)
            return false;
        String[] versionAry = version.split("\\.");

        if (!!!isEarlyAccess && versionAry[0].length() == 4)
            return false;

        if (isEarlyAccess && versionAry[0].length() != 4)
            return false;

        if (newestVersion == null)
            return true;

        String[] newestVersionAry = newestVersion.split("\\.");
        for (int i = 0; i < versionAry.length; i++) {
            if (Integer.parseInt(versionAry[i]) > Integer.parseInt(newestVersionAry[i]))
                return true;
            else if (Integer.parseInt(versionAry[i]) < Integer.parseInt(newestVersionAry[i]))
                return false;
        }
        return false;

    }
1284248
@Override
  public boolean contains(IVersion version)
  {
    for (IVersionRange range : ranges) {
      if (range.contains(version)) {
        return true;
      }
    }
    return false;
  }
901106
@Override
  public boolean contains(IVersion version)
  {

    // Can the versions be compared?
    if (!(version instanceof SemanticVersion)) {
      return false;
    }

    // We always want the extended version on the left, since it has the
    // more complex code.
    if (this.version instanceof ExtendedSemanticVersion) {
      switch (operator) {
        case ">":
          return this.version.lessThan(version);
        case ">=":
          return this.version.lessThanOrEqualTo(version);
        case "<":
          return this.version.greaterThan(version);
        case "<=":
          return this.version.greaterThanOrEqualTo(version);
        default:
          throw new IllegalArgumentException("Invalid operator: " + operator);
      }
    }
    else {
      switch (operator) {
        case "<":
          return ((SemanticVersion) version).lessThan(this.version);
        case "<=":
          return ((SemanticVersion) version).lessThanOrEqualTo(this.version);
        case ">":
          return ((SemanticVersion) version).greaterThan(this.version);
        case ">=":
          return ((SemanticVersion) version).greaterThanOrEqualTo(this.version);
        default:
          throw new IllegalArgumentException("Invalid operator: " + operator);
      }
    }
  }
433669
private static boolean ensureVersion(Version existing, Version expected) {
        return existing != Version.UNDEFINED && existing.greaterThanOrEqualTo(expected);
    }
614253
def is_required_version(required_version='0.0.0'):
    '''
    
    '''
    if 'sw-version' in DETAILS['grains_cache']:
        current_version = DETAILS['grains_cache']['sw-version']
    else:
        # If we do not have the current sw-version cached, we cannot check version requirements.
        return False

    required_version_split = required_version.split(".")
    current_version_split = current_version.split(".")

    try:
        if int(current_version_split[0]) > int(required_version_split[0]):
            return True
        elif int(current_version_split[0]) < int(required_version_split[0]):
            return False

        if int(current_version_split[1]) > int(required_version_split[1]):
            return True
        elif int(current_version_split[1]) < int(required_version_split[1]):
            return False

        if int(current_version_split[2]) > int(required_version_split[2]):
            return True
        elif int(current_version_split[2]) < int(required_version_split[2]):
            return False

        # We have an exact match
        return True
    except Exception as err:
        return False
589503
def _version_newer_than(self, vers):
        
        v = self.version(self.executable())
        vers_num = v[:v.index('-')]
        if not vers_num[0].isdigit():
            # this is the old version which is "older" than any given version
            return False

        v1 = list(map(int, vers_num.split('.')))
        v2 = list(map(int, vers.split('.')))
        assert len(v1) == 3
        assert len(v2) == 3

        if v1[0] > v2[0]:
            return True
        elif v1[0] == v2[0]:
            if v1[1] == v2[1]:
                return v1[2] >= v2[2]
            elif v1[1] > v2[1]:
                return True

        return False
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);
    }
977501
public boolean isUpdateForVersionCode() {
		Set<Integer> uniques = new HashSet<Integer>();
		for (VersionHistoryItem item : versionHistoryItems) {
			uniques.add(item.getVersionCode());
		}
		return uniques.size() > 1;
	}
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
537880
def min_version(self):
        """"""
        data = self.version_downloads
        if not data:
            return (None, 0)
        return min(data.items(), key=lambda item: item[1])