Returns True if the actual index is a valid superset of the expected index
342344
def is_valid_superset(actual_projection, index):
    """"""
    projection_type = actual_projection["ProjectionType"]
    if projection_type == "ALL":
        return True
    meta = index.model.Meta
    # all index types provide index keys and model keys
    provides = set.union(meta.keys, index.keys)
    if projection_type == "KEYS_ONLY":
        pass
    elif projection_type == "INCLUDE":  # pragma: no branch (unknown projections break loud)
        by_dynamo_name = {column.dynamo_name: column for column in meta.columns}
        provides.update(
            by_dynamo_name[name]
            for name in actual_projection["NonKeyAttributes"]
            if name in by_dynamo_name  # ignore columns the projection provides if the model doesn't care about them
        )
    else:
        logger.info(f"unexpected index ProjectionType '{projection_type}'")
        return False
    expects = index.projection["included"]
    return provides.issuperset(expects)
223561
public static boolean isScalar(INDArray indexOver, INDArrayIndex... indexes) {
        boolean allOneLength = true;
        for (int i = 0; i < indexes.length; i++) {
            allOneLength = allOneLength && indexes[i].length() == 1;
        }

        int numNewAxes = NDArrayIndex.numNewAxis(indexes);
        if (allOneLength && numNewAxes == 0 && indexes.length == indexOver.rank())
            return true;
        else if (allOneLength && indexes.length == indexOver.rank() - numNewAxes) {
            return allOneLength;
        }

        return allOneLength;
    }
1099701
def assert_subset(self, subset, superset, failure_message='Expected collection "{}" to be a subset of "{}'):
        
        assertion = lambda: set(subset).issubset(set(superset))
        failure_message = unicode(failure_message).format(superset, subset)
        self.webdriver_assert(assertion, failure_message)
274231
public boolean contains(long index) {
    assertSegmentOpen();

    if (!validIndex(index))
      return false;

    // Check the memory index first for performance reasons.
    long offset = relativeOffset(index);
    return offsetIndex.contains(offset);
  }
660839
def _fix_valid_indices(cls, valid_indices, insertion_index, dim):
        """"""
        # TODO: make this accept an immutable sequence for valid_indices
        # (a tuple) and return an immutable sequence rather than mutating an
        # argument.
        indices = np.array(sorted(valid_indices[dim]))
        slice_index = np.sum(indices <= insertion_index)
        indices[slice_index:] += 1
        indices = np.insert(indices, slice_index, insertion_index + 1)
        valid_indices[dim] = indices.tolist()
        return valid_indices
918860
def is_bin_subset(sub, sup) -> bool:
    
    sub = make_bin_array(sub)
    sup = make_bin_array(sup)

    for row in sub:
        if not (row == sup).all(axis=1).any():
            # TODO: Enable also approximate equality
            return False
    return True
629229
protected <E> void checkExistingIsSuperset(Set<E> existingSet, Set<E> newSet) {
    this.result |= !existingSet.containsAll(newSet);
  }
567260
private function checkIndexIsEligible()
    {
        $index = $this->getIndex();

        if ($index->isSecondaryGlobal() && !$index->hasAttributes($this->expr->getAttributes())) {
            throw ODMException::queryIndexProjectionIncompatible();
        }

        return (bool)$this->getKeyCondition();
    }
894797
def is_valid(self):
        
        if len(self.geometry) == 0:
            return True

        try:
            referenced = {self.graph[i][1]
                          for i in self.graph.nodes_geometry}
        except BaseException:
            # if connectivity to world frame is broken return false
            return False

        # every geometry is referenced
        ok = referenced == set(self.geometry.keys())

        return ok
475416
def is_proto(self, index):
        
        for a in self.cluster.get_aliases():
            if a.index == index and a.alias:
                return False
        return True
544348
@Override
    public boolean isOrderDeterministic() {
        if ( ! super.isOrderDeterministic()) {
            return false;
        }
        IndexScanPlanNode index_scan = getInlineIndexScan();
        if ( ! index_scan.isOrderDeterministic()) {
            m_nondeterminismDetail = index_scan.m_nondeterminismDetail;
            return false;
        }
        return true;
    }
72278
@Override
    protected void validateIndexStatus() {
        TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index);
        Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus();
        boolean isValidIndex = true;
        String invalidIndexHint;
        if (index instanceof RelationTypeIndex ||
                (index instanceof TitanGraphIndex && ((TitanGraphIndex)index).isCompositeIndex()) ) {
            SchemaStatus actualStatus = schemaVertex.getStatus();
            isValidIndex = acceptableStatuses.contains(actualStatus);
            invalidIndexHint = String.format(
                    "The index has status %s, but one of %s is required",
                    actualStatus, acceptableStatuses);
        } else {
            Preconditions.checkArgument(index instanceof TitanGraphIndex,"Unexpected index: %s",index);
            TitanGraphIndex gindex = (TitanGraphIndex)index;
            Preconditions.checkArgument(gindex.isMixedIndex());
            Map<String, SchemaStatus> invalidKeyStatuses = new HashMap<>();
            int acceptableFields = 0;
            for (PropertyKey key : gindex.getFieldKeys()) {
                SchemaStatus status = gindex.getIndexStatus(key);
                if (status!=SchemaStatus.DISABLED && !acceptableStatuses.contains(status)) {
                    isValidIndex=false;
                    invalidKeyStatuses.put(key.name(), status);
                    log.warn("Index {} has key {} in an invalid status {}",index,key,status);
                }
                if (acceptableStatuses.contains(status)) acceptableFields++;
            }
            invalidIndexHint = String.format(
                    "The following index keys have invalid status: %s (status must be one of %s)",
                    Joiner.on(",").withKeyValueSeparator(" has status ").join(invalidKeyStatuses), acceptableStatuses);
            if (isValidIndex && acceptableFields==0) {
                isValidIndex = false;
                invalidIndexHint = "The index does not contain any valid keys";
            }
        }
        Preconditions.checkArgument(isValidIndex, "The index %s is in an invalid state and cannot be indexed. %s", indexName, invalidIndexHint);
        // TODO consider retrieving the current Job object and calling killJob() if !isValidIndex -- would be more efficient than throwing an exception on the first pair processed by each mapper
        log.debug("Index {} is valid for re-indexing");
    }
702949
def ensure_index(self, key, unique=False):
        
        return self.collection.ensure_index(key, unique=unique)
711547
@Override
	public boolean satisfies(Match match, int... ind)
	{
		return match.get(ind[selfIndex]) == match.get(ind[ind.length-1]) ||
			super.satisfies(match, ind);
	}
116064
public static boolean getAt(BitSet self, int index) {
        int i = normaliseIndex(index, self.length());
        return self.get(i);
    }
928345
def exists(self, index):
        
        data = self.data
        try:
            for c in self._split(index):
                i = int(c) - 1
                data = data[i][4]
        except Exception:
            return False
        return True
272428
static boolean isSupported(int index) {
        if ((index <= 0) || (index >= NAMED_CURVE_OID_TABLE.length)) {
            return false;
        }
        if (fips == false) {
            // in non-FIPS mode, we support all valid indices
            return true;
        }
        return DEFAULT.contains(index);
    }