This method compares the children by id in the order list with the order in the
compViewParent's ui visible children and returns true if the ordering differs indicating that
the positioning if needed.
193372
static boolean hasAffectOnCVP(List<NodeInfo> order, Element compViewParent) {
        if (order.size() == 0) return false;

        int idx = 0;
        Element child = (Element) compViewParent.getFirstChild();
        NodeInfo ni = order.get(idx);

        if (child == null && ni != null) // most likely nodes to be pulled in
        return true;

        while (child != null) {
            if (child.getAttribute("hidden").equals("false")
                    && (!child.getAttribute("chanID").equals("")
                            || child.getAttribute("type").equals("regular"))) {
                if (ni.getId().equals(child.getAttribute(Constants.ATT_ID))) {
                    if (idx >= order.size() - 1) // at end of order list
                    return false;

                    ni = order.get(++idx);
                } else // if not equal then return true
                return true;
            }
            child = (Element) child.getNextSibling();
        }
        if (idx < order.size()) return true; // represents nodes to be pulled in
        return false;
    }
1114185
public boolean hasNext() {

        if (items != null) {
            if (items.hasNext()) {
                return (true);
            } else {
                items = null;
            }
        }
        Object next = findNextValidChild();
        while (next != null) {
            initializeItems(next);
            if (items != null) {
                return true;
            } else {
                next = findNextValidChild();
            }
        }
        return false;

    }
23807
def is_parent_of(page1, page2):
    

    try:
        return page1.tree_id == page2.tree_id and page1.lft < page2.lft and page1.rght > page2.rght
    except AttributeError:
        return False
626095
public final boolean isItemInsideView(int position) {
    float x = (getXForItemAtPosition(position) + offsetX);
    float y = (getYForItemAtPosition(position) + offsetY);
    float itemSize = getNoxItemSize();
    int viewWidth = shapeConfig.getViewWidth();
    boolean matchesHorizontally = x + itemSize >= 0 && x <= viewWidth;
    float viewHeight = shapeConfig.getViewHeight();
    boolean matchesVertically = y + itemSize >= 0 && y <= viewHeight;
    return matchesHorizontally && matchesVertically;
  }
1314702
private static boolean nodeListsAreEqual(final NodeList a, final NodeList b) {
        if (a == b) {
            return true;
        }
        if ((a == null) || (b == null)) {
            return false;
        }
        if (a.getLength() != b.getLength()) {
            return false;
        }
        for (int i = 0; i < a.getLength(); ++i) {
            if (!nodesAreEqual(a.item(i), b.item(i))) {
                return false;
            }
        }
        return true;
    }
378369
private boolean sortAceList(List<CmsAccessControlEntry> aces) {

        // sort the list of entries
        Collections.sort(aces, CmsAccessControlEntry.COMPARATOR_ACE);
        // after sorting just the first 2 positions come in question
        for (int i = 0; i < Math.min(aces.size(), 2); i++) {
            CmsAccessControlEntry acEntry = aces.get(i);
            if (acEntry.getPrincipal().equals(CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID)) {
                return true;
            }
        }
        return false;
    }
751218
function sort(children, sortOrder) {
    if (typeof sortOrder === 'function') {
        return children.sort(sortOrder);
    }
    else {
        var isAsc = sortOrder === 'asc';
        return children.sort(function (a, b) {
            var diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : -1);
            return diff === 0
                ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1)
                : diff;
        });
    }
}
358457
private boolean isParent(ItemData data, ItemData parent)
   {
      String id1 = data.getParentIdentifier();
      String id2 = parent.getIdentifier();
      if (id1 == id2) // NOSONAR 
         return true;
      if (id1 == null && id2 != null)
         return false;
      return id1 != null && id1.equals(id2);
   }
962521
private boolean updateAnchorFromChildren(RecyclerView.State state, AnchorInfo anchorInfo) {
        if (getChildCount() == 0) {
            return false;
        }
        final View focused = getFocusedChild();
        if (focused != null && anchorInfo.isViewValidAsAnchor(focused, state)) {
            anchorInfo.assignFromViewAndKeepVisibleRect(focused);
            return true;
        }
        /*
        if (mLastStackFromEnd != mStackFromEnd) {
            return false;
        }
        */
        View referenceChild = anchorInfo.mLayoutFromEnd ? findReferenceChildClosestToEnd(state)
                : findReferenceChildClosestToStart(state);
        if (referenceChild != null) {
            anchorInfo.assignFromView(referenceChild);
            // If all visible views are removed in 1 pass, reference child might be out of bounds.
            // If that is the case, offset it back to 0 so that we use these pre-layout children.
            if (!state.isPreLayout() && supportsPredictiveItemAnimations()) {
                // validate this child is at least partially visible. if not, offset it to start
                final boolean notVisible =
                        mOrientationHelper.getDecoratedStart(referenceChild) >= mOrientationHelper
                                .getEndAfterPadding()
                                || mOrientationHelper.getDecoratedEnd(referenceChild)
                                < mOrientationHelper.getStartAfterPadding();
                if (notVisible) {
                    anchorInfo.mCoordinate = anchorInfo.mLayoutFromEnd
                            ? mOrientationHelper.getEndAfterPadding()
                            : mOrientationHelper.getStartAfterPadding();
                }
            }
            return true;
        }
        return false;
    }
1123346
def is_view_child(view, par):
    '''
    
    '''
    if par.base is None:
        # par is the base array.
        return view.base is par
    else:
        # par is a view of another array as well!
        # view can only be a child of par if they share base.
        return view.base is par.base
234436
public boolean nextSibling() {
        if (mNode == null) {
            return false;
        }
        AccessibilityNodeInfoCompat parent = mNode.getParent();
        if (parent == null) {
            return false;
        }
        try {
            int childCount = parent.getChildCount();
            int childNumber = getChildNumber(parent);
            if (childNumber < 0) {
                return false;
            }
            for (int i = childNumber + 1; i < childCount; ++i) {
                AccessibilityNodeInfoCompat newNode =
                        parent.getChild(i);
                if (newNode == null) {
                    return false;
                }
                if (AccessibilityNodeInfoUtils.isVisibleOrLegacy(newNode)) {
                    reset(newNode);
                    return true;
                }
                newNode.recycle();
            }
        } finally {
            parent.recycle();
        }
        return false;
    }
361068
public final boolean isViewSufficientlyShown(View view){
		final int[] xyView = new int[2];
		final int[] xyParent = new int[2];

		if(view == null)
			return false;

		final float viewHeight = view.getHeight();
		final View parent = getScrollOrListParent(view);
		view.getLocationOnScreen(xyView);

		if(parent == null){
			xyParent[1] = 0;
		}
		else{
			parent.getLocationOnScreen(xyParent);
		}

		if(xyView[1] + (viewHeight/2.0f) > getScrollListWindowHeight(view))
			return false;

		else if(xyView[1] + (viewHeight/2.0f) < xyParent[1])
			return false;

		return true;
	}
819734
public int compareTo(ExtensionComponent<T> that) {
        double a = this.ordinal();
        double b = that.ordinal();
        if (a>b)    return -1;
        if (a<b)    return 1;

        // make the order bit more deterministic among extensions of the same ordinal
        if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) {
            try {
                return Util.fixNull(((Descriptor)this.instance).getDisplayName()).compareTo(Util.fixNull(((Descriptor)that.instance).getDisplayName()));
            } catch (RuntimeException | LinkageError x) {
                LOG.log(Level.WARNING, null, x);
            }
        }
        return this.instance.getClass().getName().compareTo(that.instance.getClass().getName());
    }
1241415
function firstVisibleChild() {
        for (var i = 0; i < openMenuNode.children.length; ++i) {
          if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') {
            return openMenuNode.children[i];
          }
        }
      }
454260
public function hasVisibleChildren()
    {
        if (is_array($this->children) && count($this->children)) {
            foreach ($this->children as $child) {
                if (!$child->isHidden()) {
                    return true;
                }
            }
        }

        return false;
    }
236516
private boolean hasFallbackChildren()
  {
    for (ElemTemplateElement child = m_firstChild; child != null;
             child = child.m_nextSibling)
    {
      if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK)
        return true;
    }
    
    return false;
  }
991010
public function shouldDisplay(): bool
    {
        if ($this->before || $this->after) {
            return true;
        }

        return (bool) count($this->children);
    }