Checks if a rest expression is present in the node's children.
961741
function hasRest (node) {
    for (var i = 0, child; (child = node.children[i]); i++) {
      if (child.type === "rest") return true;
    }
    return false;
  }
1033409
static <K,V> boolean checkInvariants(TreeNode<K,V> t) {
            TreeNode<K,V> tp = t.parent, tl = t.left, tr = t.right,
                tb = t.prev, tn = (TreeNode<K,V>)t.next;
            if (tb != null && tb.next != t)
                return false;
            if (tn != null && tn.prev != t)
                return false;
            if (tp != null && t != tp.left && t != tp.right)
                return false;
            if (tl != null && (tl.parent != t || tl.hash > t.hash))
                return false;
            if (tr != null && (tr.parent != t || tr.hash < t.hash))
                return false;
            if (t.red && tl != null && tl.red && tr != null && tr.red)
                return false;
            if (tl != null && !checkInvariants(tl))
                return false;
            if (tr != null && !checkInvariants(tr))
                return false;
            return true;
        }
1334494
private void checkAst(Node externs, Node root) {
    astValidator.validateCodeRoot(externs);
    astValidator.validateCodeRoot(root);
  }
66547
function hasSameTokens(nodeA, nodeB) {
            const tokensA = sourceCode.getTokens(nodeA);
            const tokensB = sourceCode.getTokens(nodeB);

            return tokensA.length === tokensB.length &&
                tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value);
        }
206908
static boolean nodeAbsent(Object json, Path path, boolean treatNullAsAbsent) {
        Node node = getNode(json, path);
        if (node.isNull()) {
            return treatNullAsAbsent;
        } else {
            return node.isMissingNode();
        }
    }
851662
function check(node) {
            if (TARGET_NODE_TYPE.test(node.parent.type) &&
                isMixedWithParent(node) &&
                !shouldIgnore(node)
            ) {
                reportBothOperators(node);
            }
        }
32781
public static boolean hasChildren(final Element el) throws SAXException {
    NodeList children = el.getChildNodes();

    for (int i = 0; i < children.getLength(); i++) {
      Node curnode = children.item(i);

      short ntype =  curnode.getNodeType();
      if ((ntype != Node.TEXT_NODE) &&
          (ntype != Node.CDATA_SECTION_NODE) &&
          (ntype != Node.COMMENT_NODE)) {
        return true;
      }
    }

    return false;
  }
140050
function containsNode(outerNode, innerNode) {
  if (!outerNode || !innerNode) {
    return false;
  } else if (outerNode === innerNode) {
    return true;
  } else if (isTextNode(outerNode)) {
    return false;
  } else if (isTextNode(innerNode)) {
    return containsNode(outerNode, innerNode.parentNode);
  } else if (outerNode.contains) {
    return outerNode.contains(innerNode);
  } else if (outerNode.compareDocumentPosition) {
    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  } else {
    return false;
  }
}
393939
public boolean isLvalue() {
    Node parent = getParent();
    Token parentType = parent.getToken();
    switch (parentType) {
      case VAR:
      case LET:
      case CONST:
        return (nameNode.hasChildren() || isLhsOfEnhancedForExpression(nameNode));
      case DEFAULT_VALUE:
        return parent.getFirstChild() == nameNode;
      case INC:
      case DEC:
      case CATCH:
      case REST:
      case PARAM_LIST:
        return true;
      case FOR:
      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
        return NodeUtil.isEnhancedFor(parent) && parent.getFirstChild() == nameNode;
      case ARRAY_PATTERN:
      case STRING_KEY:
      case COMPUTED_PROP:
        return NodeUtil.isLhsByDestructuring(nameNode);
      default:
        return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == nameNode);
    }
  }
270312
function query(node, matcher, halter) {
    var list = [];
    this._queryElements(tree.Logical.getChildNodes(node), matcher,
      halter, list);
    return list;
  }
397090
function checkChildren( children, newParentName ) {
		var allowed = DTD[ newParentName ];

		for ( var i = 0, l = children.length, child; i < l; ++i ) {
			child = children[ i ];
			if ( child.type == CKEDITOR.NODE_ELEMENT && !allowed[ child.name ] )
				return false;
		}

		return true;
	}
716988
function checkChildren(mutation, node, seen) {

	var attr,
	    k,
	    l;

	if (seen == null) {
		seen = initial_seen;
	}

	// Ignore text nodes
	if (node.nodeType === 3 || node.nodeType === 8) {
		return;
	}

	// Only check attributes for nodes that haven't been checked before
	if (!seen.get(node)) {

		// Indicate this node has been checked
		seen.set(node, true);

		// Go over every attribute
		if (node.attributes) {
			for (k = 0; k < node.attributes.length; k++) {
				attr = node.attributes[k];

				if (attributes[attr.name]) {
					for (l = 0; l < attributes[attr.name].length; l++) {
						attributes[attr.name][l](node, attr.value, null, true);
					}
				}
			}
		}
	}

	// Now check the children
	for (k = 0; k < node.childNodes.length; k++) {
		checkChildren(mutation, node.childNodes[k], seen);
	}
}
696366
private boolean isChildAllowed(final InternalQName childName, final InternalQName childNodeType,
      final NodeDefinitionData cnd, InternalQName reqName, final InternalQName reqNodeType)
   {
      return childNodeType.equals(reqNodeType) && (cnd.isResidualSet() || reqName.equals(childName));
   }
755451
function isWrappedInParenthesis(node) {
            const regex = /^return\s*?\(\s*?\);*?/u;

            const statementWithoutArgument = sourceCode.getText(node).replace(
                sourceCode.getText(node.argument), ""
            );

            return regex.test(statementWithoutArgument);
        }
93278
private static boolean isDeclaration(Node n) {
    switch (n.getParent().getToken()) {
      case LET:
      case CONST:
      case VAR:
      case CATCH:
        return true;
      case FUNCTION:
        return n == n.getParent().getFirstChild();

      case PARAM_LIST:
        return n.getGrandparent().isFunction();

      default:
        return false;
    }
  }
738587
def is_docstring(node):
    
    return (node.type == syms.simple_stmt and
            len(node.children) > 0 and node.children[0].type == token.STRING)
407827
private static StaticAnalysisResult isListExpressionEmpty(ForNode node) {
    Optional<RangeArgs> rangeArgs = RangeArgs.createFromNode(node);
    if (rangeArgs.isPresent()) {
      return isRangeExpressionEmpty(rangeArgs.get());
    }
    ExprNode expr = node.getExpr().getRoot();
    if (expr instanceof ListLiteralNode) {
      return ((ListLiteralNode) expr).numChildren() > 0
          ? StaticAnalysisResult.FALSE
          : StaticAnalysisResult.TRUE;
    }
    return StaticAnalysisResult.UNKNOWN;
  }