Test if an instance is within the given ranges.

@param instance 	the instance
@param ranges 	the ranges the instance is tested to be in
@return true 	if instance is within the ranges
434212
public boolean inRanges(Instance instance, double[][] ranges) {
    boolean isIn = true;
    
    // updateRangesFirst must have been called on ranges
    for (int j = 0; isIn && (j < ranges.length); j++) {
      if (!instance.isMissing(j)) {
        double value = instance.value(j);
        isIn = value <= ranges[j][R_MAX];
        if (isIn) isIn = value >= ranges[j][R_MIN];
      }
    }
    
    return isIn;
  }
1070981
public static boolean contains(Range range, Range subrange) {
        return range.getMinimum().doubleValue() <= subrange.getMinimum().doubleValue()
                && range.getMaximum().doubleValue() >= subrange.getMaximum().doubleValue();
        
    }
1043163
@SuppressWarnings("unchecked")
    public List<Range> without(Range range) {
        if (!intersectsWith(range))
            return Collections.singletonList(this);

        if (upper <= range.upper)
            return range.lower <= lower ? Collections.EMPTY_LIST : Collections.singletonList(new Range(lower, range.lower, reversed));

        if (range.lower <= lower)
            return Collections.singletonList(new Range(range.upper, upper, reversed));

        return Arrays.asList(new Range(lower, range.lower, reversed), new Range(range.upper, upper, reversed));
    }
608235
public boolean containsRange(Range<T> otherRange) {
    if (otherRange == null) { return false; }
    return contains(otherRange.min) && contains(otherRange.max);
  }
1263173
def _check_insersection(self, version, ranges):
        """"""

        for ver_range in ranges:
            if not self._check_ver_range(version, ver_range):
                return False

        return True
401575
public static <T> Collection<T> findAmongst(Class<T> clazz, Object ... instances) {
    return findAmongst(clazz, Arrays.asList(instances));
  }
463965
function isInstanceOf(cls) {
        var i, l, bases = this.constructor._meta.bases;
        for (i = 0, l = bases.length; i < l; i += 1) {
            if (bases[i] === cls) {
                return true;
            }
        }
        return this instanceof cls;
    }
466292
public boolean isBeforeRange(Range<T> otherRange) {
    if (otherRange == null) { return false; }
    return isBefore(otherRange.min);
  }
1250288
private boolean isWithin(JavaVersion runningVersion, Range range,
			JavaVersion version) {
		if (range == Range.EQUAL_OR_NEWER) {
			return runningVersion.isEqualOrNewerThan(version);
		}
		if (range == Range.OLDER_THAN) {
			return runningVersion.isOlderThan(version);
		}
		throw new IllegalStateException("Unknown range " + range);
	}
1267141
function isEqualRange(range1, range2) {
    return range1.from === range2.from && range1.to === range2.to;
}
578183
private boolean isInstanceStopped(Instance myInstance) {
        InstanceState instanceState = myInstance.getState();
        return (instanceState.getName().equals("stopped"));
    }
167815
def has_active_condition(self, conditions, instances):
        
        return_value = None
        for instance in itertools.chain(instances, [None]):
            if not self.can_execute(instance):
                continue
            result = self.is_active(instance, conditions)
            if result is False:
                return False
            elif result is True:
                return_value = True
        return return_value
281168
def is_instance_collection(c, cls):
    
    if not (hasattr(c, '__iter__') and len(c) > 0):
        # make sure it's iterable and not empty
        return False

    cls = make_list(cls)
    for i in get_collection_values(c):
        instance = False
        for cl in cls:
            if isinstance(i, cl):
                instance = True
                break
        if not instance:
            return False

    return True
18557
@Override
  public boolean intersects(IVersionRange yourRange)
  {
    return range1.intersects(yourRange) && range2.intersects(yourRange);
  }
1187041
public static boolean isTarget( Instance instance ) {
		return instance.getComponent() != null
				&& ComponentHelpers.isTarget( instance.getComponent());
	}
1159101
public boolean containsRange(final Range<T> other) {
        if (other == null) {
            return false;
        }

        return (other.lowerEndpoint.isClosed ? contains(other.lowerEndpoint.value) : lowerEndpoint.value.compareTo(other.lowerEndpoint.value) <= 0)
                && (other.upperEndpoint.isClosed ? contains(other.upperEndpoint.value) : upperEndpoint.value.compareTo(other.upperEndpoint.value) >= 0);
    }
1177203
public void setInstancesToProtect(java.util.Collection<String> instancesToProtect) {
        if (instancesToProtect == null) {
            this.instancesToProtect = null;
            return;
        }

        this.instancesToProtect = new com.amazonaws.internal.SdkInternalList<String>(instancesToProtect);
    }