Verifies the structure of the tree (does bounds checking on each node)
@return true if the structure of the tree
is correct.
762013
public boolean isCorrect() {
        MemoryWorkspace workspace =
                workspaceMode == WorkspaceMode.NONE ? new DummyWorkspace()
                        : Nd4j.getWorkspaceManager().getWorkspaceForCurrentThread(
                        workspaceConfigurationExternal,
                        workspaceExternal);
        try (MemoryWorkspace ws = workspace.notifyScopeEntered()) {

            for (int n = 0; n < size; n++) {
                INDArray point = data.slice(index[n]);
                if (!boundary.contains(point))
                    return false;
            }
            if (!isLeaf()) {
                boolean correct = true;
                for (int i = 0; i < numChildren; i++)
                    correct = correct && children[i].isCorrect();
                return correct;
            }

            return true;
        }
    }

    /**
     * The depth of the node
     * @return the depth of the node
     */
    public int depth() {
        if (isLeaf())
            return 1;
        int depth = 1;
        int maxChildDepth = 0;
        for (int i = 0; i < numChildren; i++) {
            maxChildDepth = Math.max(maxChildDepth, children[0].depth());
        }

        return depth + maxChildDepth;
    }

    private void fill(int n) {
        if (indices.isEmpty() && parent == null)
            for (int i = 0; i < n; i++) {
                log.trace("Inserted " + i);
                insert(i);
            }
        else
            log.warn("Called fill already");
    }


    public SpTree[] getChildren() {
        return children;
    }

    public int getD() {
        return D;
    }

    public INDArray getCenterOfMass() {
        return centerOfMass;
    }

    public Cell getBoundary() {
        return boundary;
    }

    public int[] getIndex() {
        return index;
    }

    public int getCumSize() {
        return cumSize;
    }

    public void setCumSize(int cumSize) {
        this.cumSize = cumSize;
    }

    public int getNumChildren() {
        return numChildren;
    }

    public void setNumChildren(int numChildren) {
        this.numChildren = numChildren;
    }

}
722275
boolean isIdenticalTree(MathNode aTree, MathNode bTree) {
        // first check if they have the same number of children
        if (aTree.equals(bTree) && aTree.getChildren().size() == bTree.getChildren().size()) {
            if (aTree.isOrderSensitive()) {
                // all children order sensitive
                for (int i = 0; i < aTree.getChildren().size(); i++) {
                    if (!isIdenticalTree(aTree.getChildren().get(i), bTree.getChildren().get(i))) {
                        return false;
                    }
                }
            } else {
                // order insensitive
                List<MathNode> bChildren = new ArrayList<>(bTree.getChildren());
                OUTER:
                for (MathNode aChild : aTree.getChildren()) {
                    for (MathNode bChild : filterSameChildren(aChild, bChildren)) {
                        if (isIdenticalTree(aChild, bChild)) {
                            // found an identical child
                            bChildren.remove(bChild);
                            continue OUTER;
                        }
                    }
                    // aChild is missing in bChildren
                    return false;
                }
            }
            return true;
        }
        return false;
    }
230958
@Override
	public boolean isInstantiated() {
		if (getPotentialNodes().size() != getMandatoryNodes().size()) {
			return false;
		}
		ISet suc;
		for (int i : getUB().getNodes()) {
			suc = UB.getSuccOrNeighOf(i);
			if (suc.size() != getLB().getSuccOrNeighOf(i).size()) {
				return false;
			}
		}
		return true;
	}
1070801
private boolean isValid() {

        return m_typeID.isValid()
            && m_typeShortName.isValid()
            && m_parentFormatter.isValid()
            && m_parentSchema.isValid()
            && m_bundle.isValid()
            && m_config.isValid()
            && m_typeDescription.isValid()
            && m_typeName.isValid()
            && m_typeXPathName.isValid();
    }
556118
public boolean isInStruct()
    {
        boolean in_struct = false;
        IonType container = getContainerType();
        if (IonType.STRUCT.equals(container)) {
            if (getDepth() > 0) {
                in_struct = true;
            }
            else {
                assert(IonType.STRUCT.equals(_nesting_parent) == true);
            }
        }
        return in_struct;
    }
880325
public boolean isValid() {
		if (this.cpuCores >= 0 && this.heapMemoryInMB >= 0 && this.directMemoryInMB >= 0 &&
				this.nativeMemoryInMB >= 0 && this.stateSizeInMB >= 0) {
			for (Resource resource : extendedResources.values()) {
				if (resource.getValue() < 0) {
					return false;
				}
			}
			return true;
		} else {
			return false;
		}
	}
93169
public boolean isOrderDeterministic() {
        // Leaf nodes need to re-implement this test.
        assert(m_children != null);
        for (AbstractPlanNode child : m_children) {
            if (! child.isOrderDeterministic()) {
                m_nondeterminismDetail = child.m_nondeterminismDetail;
                return false;
            }
        }
        return true;
    }
823574
public boolean isValid() {
		if (isEmpty()) {
			return true;
		}
		if (!exteriorRing.isValid()) {
			return false;
		}
		if (interiorRings != null) {
			LinearRing ring1;
			LinearRing ring2;
			for (int i = 0; i <= interiorRings.length; i++) {
				if (i == interiorRings.length) {
					ring1 = exteriorRing;
				} else {
					ring1 = interiorRings[i];
					if (!ring1.isValid()) {
						return false;
					}
				}
				for (int j = 0; j <= interiorRings.length; j++) {
					if (i == j) {
						continue;
					}
					if (j == interiorRings.length) {
						ring2 = exteriorRing;
					} else {
						ring2 = interiorRings[j];
					}
					if (ring1.intersects(ring2)) {
						return false;
					}
				}
			}
		}

		return true;
	}
1020656
public final function verify(){

        foreach($this->definition as $k => $v){
            $this->verifyData($k);
        }//foreach

        if(count($this->errors)){
            return false;
        }//if

        return true;

    }
699936
@Override
  protected boolean hasUnderflow(FlatRStarTreeNode node) {
    if(node.isLeaf()) {
      return node.getNumEntries() < leafMinimum;
    }
    else {
      return false;
    }
  }
438071
static boolean isLoopStructure(Node n) {
    switch (n.getToken()) {
      case FOR:
      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
      case DO:
      case WHILE:
        return true;
      default:
        return false;
    }
  }
1249942
def verify_consistency(self, expected_leaf_count) -> bool:
        
        if expected_leaf_count != self.leafCount:
            raise ConsistencyVerificationFailed()
        if self.get_expected_node_count(self.leafCount) != self.nodeCount:
            raise ConsistencyVerificationFailed()
        return True
982113
private Boolean hasChildNodes(Node n) {
        boolean flag = n.hasChildNodes();
        if (flag && XMLUnit.getIgnoreComments()) {
            List nl = nodeList2List(n.getChildNodes());
            flag = !nl.isEmpty();
        }
        return flag ? Boolean.TRUE : Boolean.FALSE;
    }
330179
private boolean isSameStructure(INode source, INode target) {
        boolean result = false;
        if (null != source && null != target) {
            if (source.getChildrenList() != null && target.getChildrenList() != null) {
                int sourceChildren = source.getChildrenList().size();
                int targetChildren = target.getChildrenList().size();
                if (sourceChildren == 0 && targetChildren == 0) {
                    result = true;
                } else if (sourceChildren > 0 && targetChildren > 0) {
                    result = true;
                }
            } else if (source.getChildrenList() == null && target.getChildrenList() == null) {
                result = true;
            }
        } else if (null == source && null == target) {
            result = true;
        }
        return result;
    }
844289
public boolean validate()
  {
    boolean correct = true;
    if (population() > 1)
    {
      java.util.Comparator comp = index().insertComparator();
      int xcc = 0;
      for (int i = 0; i < population()-1; i++)
      {
        xcc = comp.compare(_nodeKey[i], _nodeKey[i+1]);
        if ( !(xcc < 0) )
          {
            System.out.println("Entry " + i + " not less than entry " + i+1);
            correct = false;
          }
      }
    }
    return correct;
  }
146353
public boolean isCompleteExceptIgnoredNodes() {
        synchronized (nodeStack) {
            if (nodeStack.isEmpty() && retainedNodes.isEmpty()) {
                return true;
            } else {
                // Check that remaining nodes can be ignored
                for (int i=0; i < nodeStack.size(); i++) {
                    if (!ignoredNodes.contains(nodeStack.get(i))) {
                        return false;
                    }
                }
                for (int i=0; i < retainedNodes.size(); i++) {
                    if (!ignoredNodes.contains(retainedNodes.get(i))) {
                        return false;
                    }
                }
                return true;
            }
        }
    }
811336
public boolean isValid() {
        if (ints == null) {
            throw new IllegalStateException("ints is null");
        }
        if (length < 0) {
            throw new IllegalStateException("length is negative: " + length);
        }
        if (length > ints.length) {
            throw new IllegalStateException("length is out of bounds: " + length + ",ints.length=" + ints.length);
        }
        if (offset < 0) {
            throw new IllegalStateException("offset is negative: " + offset);
        }
        if (offset > ints.length) {
            throw new IllegalStateException("offset out of bounds: " + offset + ",ints.length=" + ints.length);
        }
        if (offset + length < 0) {
            throw new IllegalStateException("offset+length is negative: offset=" + offset + ",length=" + length);
        }
        if (offset + length > ints.length) {
            throw new IllegalStateException("offset+length out of bounds: offset=" + offset + ",length=" + length + ",ints.length=" + ints.length);
        }
        return true;
    }