Removes any enclosing parentheses from the tree.
322891
public static Tree stripParentheses(Tree tree) {
    while (tree instanceof ParenthesizedTree) {
      tree = ((ParenthesizedTree) tree).getExpression();
    }
    return tree;
  }
99297
private static void delDefault(Tree<Node> tree){
		if(!tree.isLeaf()){
			for(int i=0;i<tree.children.size();i++){
				if(isDefault(tree.getChild(i))){
					tree.removeChild(i); 
				}
			}
			for(int i=0;i<tree.children.size();i++){
				delDefault(tree.getChild(i));
			}
		}	
	}
171280
void removeInlinedFunctions() {
    for (Map.Entry<String, FunctionState> entry : fns.entrySet()) {
      String name = entry.getKey();
      FunctionState functionState = entry.getValue();
      if (functionState.canRemove()) {
        Function fn = functionState.getFn();
        checkState(functionState.canInline());
        checkState(fn != null);
        verifyAllReferencesInlined(name, functionState);
        fn.remove();
        NodeUtil.markFunctionsDeleted(fn.getFunctionNode(), compiler);
      }
    }
  }
1156700
function() {
        var child;
        var root = this.vectorRoot;
        if (root) {
            while (child = root.firstChild) {
                root.removeChild(child);
            }
        }
        root = this.textRoot;
        if (root) {
            while (child = root.firstChild) {
                root.removeChild(child);
            }
        }
        if (this.indexer) {
            this.indexer.clear();
        }
    }
304176
public void remove(int node) {
        if (node == NIL) {
            throw new IllegalArgumentException();
        }
        if (left(node) != NIL && right(node) != NIL) {
            // inner node
            final int next = next(node);
            assert next != NIL;
            swap(node, next);
        }
        assert left(node) == NIL || right(node) == NIL;

        final int parent = parent(node);
        int child = left(node);
        if (child == NIL) {
            child = right(node);
        }

        if (child == NIL) {
            // no children
            if (node == root) {
                assert size() == 1 : size();
                root = NIL;
            } else {
                if (node == left(parent)) {
                    left(parent, NIL);
                } else {
                    assert node == right(parent);
                    right(parent, NIL);
                }
            }
        } else {
            // one single child
            if (node == root) {
                assert size() == 2;
                root = child;
            } else if (node == left(parent)) {
                left(parent, child);
            } else {
                assert node == right(parent);
                right(parent, child);
            }
            parent(child, parent);
        }

        release(node);
        rebalance(parent);
    }
518253
private void unlinkLast(Node<E> last, Node<E> prev) {
        // assert last != null;
        // assert prev != null;
        // assert last.item == null;
        for (Node<E> o = null, p = prev, q;;) {
            if (p.item != null || (q = p.prev) == null) {
                if (o != null && p.next != p && last.casPrev(prev, p)) {
                    skipDeletedSuccessors(p);
                    if (last.next == null &&
                        (p.prev == null || p.item != null) &&
                        p.next == last) {

                        updateHead(); // Ensure o is not reachable from head
                        updateTail(); // Ensure o is not reachable from tail

                        // Finally, actually gc-unlink
                        o.lazySetPrev(o);
                        o.lazySetNext(nextTerminator());
                    }
                }
                return;
            }
            else if (p == q)
                return;
            else {
                o = p;
                p = q;
            }
        }
    }
1370427
function removeBindings() {
      for (var i = 0; i < this._c.length; i++) {
        this.unbind(this._c[i].children);
      }
    }
403153
function trimLeadingLineBreaks(node) {
          do {
            if (node.nodeType === 3) {
              node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
            }

            node = node.firstChild;
          } while (node);
        }
148526
function removeWhile(node, pred) {
  while (node) {
    if (isEditable(node) || !pred(node)) {
      break;
    }

    const parent = node.parentNode;
    remove(node);
    node = parent;
  }
}
502000
private void removeUseless() {
    Set<Map.Entry<String, PropertyNode>> entries = _children.entrySet();
    for (Iterator<Map.Entry<String, PropertyNode>> it = entries.iterator(); it.hasNext(); ) {
      Map.Entry<String, PropertyNode> entry = it.next();
      PropertyNode child = entry.getValue();
      child.removeUseless();
      if (child.isUseless()) {
        it.remove();
      }
    }
  }
490624
function cleanHeaders(e) {
  for (var headerIndex = 1; headerIndex < 7; headerIndex++) {
    var headers = e.getElementsByTagName('h' + headerIndex);
    for (var i = headers.length - 1; i >= 0; --i) {
      if (getClassWeight(headers[i]) < 0 || getLinkDensity(headers[i]) > 0.33) {
        headers[i].parentNode.removeChild(headers[i]);
      }
    }
  }
}
434271
def Trim(self, flags):
        
        logger.info("Trimming!")
        flags = bytearray(flags)
        length = 1 << self.Depth - 1
        while len(flags) < length:
            flags.append(0)

        MerkleTree._TrimNode(self.Root, 0, self.Depth, flags)
1101454
function removeUnusedProperties(node) {
    if (typeof node !== "object") {
        return;
    }
    ["position"].forEach(function (key) {
        if (node.hasOwnProperty(key)) {
            delete node[key];
        }
    });
}
1099402
def trim_tree(self, node):
        """"""
        data_len = len(node[-1])

        if node[1] == -1 and node[2] == -1:
            if data_len == 0:
                return 1
            else:
                return 0
        else:
            if self.trim_tree(node[1]) == 1:
                node[1] = -1

            if self.trim_tree(node[2]) == 1:
                node[2] = -1

            if node[1] == -1 and node[2] == -1:
                if data_len == 0:
                    return 1
                else:
                    return 0
1162663
private void removeDuplicateDeclarations(Node externs, Node root) {
    Callback tickler = new ScopeTicklingCallback();
    ScopeCreator scopeCreator =
        new Es6SyntacticScopeCreator(compiler, new DuplicateDeclarationHandler());
    NodeTraversal t = new NodeTraversal(compiler, tickler, scopeCreator);
    t.traverseRoots(externs, root);
  }
637503
private static void cleanStyles(Element e) {
        if (e == null) {
            return;
        }

        Element cur = e.children().first();

        // Remove any root styles, if we're able.
        if (!"readability-styled".equals(e.className())) {
            e.removeAttr("style");
        }

        // Go until there are no more child nodes
        while (cur != null) {
            // Remove style attributes
            if (!"readability-styled".equals(cur.className())) {
                cur.removeAttr("style");
            }
            cleanStyles(cur);
            cur = cur.nextElementSibling();
        }
    }
234676
def clean(self):
        
        super(CTENode, self).clean()
        if self.parent and self.pk in getattr(self.parent, self._cte_node_path):
            raise ValidationError(_("A node cannot be made a descendant of itself."))