Removes any scope nodes from the provided list that are nested within some other scope node
also in the list. Returns the modified list.
543559
public static List<Node> removeNestedChangeScopeNodes(List<Node> scopeNodes) {
    Set<Node> uniqueScopeNodes = new LinkedHashSet<>(scopeNodes);
    for (Node scopeNode : scopeNodes) {
      for (Node ancestor = scopeNode.getParent();
          ancestor != null;
          ancestor = ancestor.getParent()) {
        if (isChangeScopeRoot(ancestor) && uniqueScopeNodes.contains(ancestor)) {
          uniqueScopeNodes.remove(scopeNode);
          break;
        }
      }
    }
    return new ArrayList<>(uniqueScopeNodes);
  }
1215005
public List<AstNode> removeAllChildren() {
        if (this.children.isEmpty()) {
            return new ArrayList<AstNode>(0);
        }
        List<AstNode> copyOfChildren = new ArrayList<AstNode>(this.children);
        for (Iterator<AstNode> childIter = this.children.iterator(); childIter.hasNext();) {
            AstNode child = childIter.next();
            childIter.remove();
            child.parent = null;
        }
        return copyOfChildren;
    }
1023876
def remove_children(self, reset_parent=True):
        
        if reset_parent:
            for child in self.children:
                child.parent = None
        self.__children = []
766748
public List<Item> deleteAllSelectedItems() {
        List<Item> deletedItems = new ArrayList<>();

        final List<Integer> positions = new ArrayList<>();
        mFastAdapter.recursive(new AdapterPredicate<Item>() {
            @Override
            public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) {
                if (item.isSelected()) {
                    //if it's a subitem remove it from the parent
                    if (item instanceof ISubItem) {
                        //a sub item which is not in the list can be instantly deleted
                        IExpandable parent = (IExpandable) ((ISubItem) item).getParent();
                        //parent should not be null, but check in any case..
                        if (parent != null) {
                            parent.getSubItems().remove(item);
                        }
                    }
                    if (position != -1) {
                        //a normal displayed item can only be deleted afterwards
                        positions.add(position);
                    }
                }
                return false;
            }
        }, false);

        //we have to re-fetch the selections array again and again as the position will change after one item is deleted
        for (int i = positions.size() - 1; i >= 0; i--) {
            FastAdapter.RelativeInfo<Item> ri = mFastAdapter.getRelativeInfo(positions.get(i));
            if (ri.item != null && ri.item.isSelected()) { //double verify
                if (ri.adapter != null && ri.adapter instanceof IItemAdapter) {
                    ((IItemAdapter) ri.adapter).remove(positions.get(i));
                }
            }
        }
        return deletedItems;
    }
991267
public static <T> boolean removeAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection)
    {
        if (iterable == null)
        {
            throw new NullPointerException();
        }
        if (iterable instanceof Collection<?>)
        {
            return targetCollection.removeAll((Collection<T>) iterable);
        }
        int oldSize = targetCollection.size();
        Iterate.forEachWith(iterable, Procedures2.<T>removeFromCollection(), targetCollection);
        return targetCollection.size() != oldSize;
    }
114173
def strip_tree(node,
               # Runtime optimization
               iter_node=iter_node, special=ast.AST,
               list=list, isinstance=isinstance, type=type, len=len):
    
    stripped = set()

    def strip(node, indent):
        unknown = set()
        leaf = True
        for subnode, _ in iter_node(node, unknown=unknown):
            leaf = False
            strip(subnode, indent + '    ')
        if leaf:
            if isinstance(node, special):
                unknown = set(vars(node))
        stripped.update(unknown)
        for name in unknown:
            delattr(node, name)
        if hasattr(node, 'ctx'):
            delattr(node, 'ctx')
            if 'ctx' in node._fields:
                mylist = list(node._fields)
                mylist.remove('ctx')
                node._fields = mylist
    strip(node, '')
    return stripped
591436
private static List<Integer> stripNodeIds(List<Node> nodeList) {
        List<Integer> nodeidList = new ArrayList<Integer>();
        if(nodeList != null) {
            for(Node node: nodeList) {
                nodeidList.add(node.getId());
            }
        }
        return nodeidList;
    }
399734
def remove(self, list):
        
        xml = SP.DeleteList(SP.listName(list.id))
        self.opener.post_soap(LIST_WEBSERVICE, xml,
                              soapaction='http://schemas.microsoft.com/sharepoint/soap/DeleteList')
        self.all_lists.remove(list)
298224
def remove(self):
        
        DoubleLinkedListItem.remove(self)     # remove from double linked list
        if self.succ is self:                 # list was a singleton
            self.theclass.items = None        # class is empty
        elif self.theclass.items is self:     # oups we removed the head
            self.theclass.items = self.succ
871683
function removeDuplicates(collection) {
  return collection.filter(function(e, i, arr) {
    return isValue(e) && arr.lastIndexOf(e) === i;
  });
}
1351562
int deleteElement(int list, int node) {
		int prev = getPrev(node);
		int next = getNext(node);
		if (prev != nullNode())
			setNext_(prev, next);
		else
			m_lists.setField(list, 0, next);// change head
		if (next != nullNode())
			setPrev_(next, prev);
		else
			m_lists.setField(list, 1, prev);// change tail

		freeNode_(node);
		setListSize_(list, getListSize(list) - 1);
		return next;
	}
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);
  }
265887
private Node removeNodeRecursively(final NodeImpl node, final ArchivePath path) {
        final NodeImpl parentNode = content.get(path.getParent());
        if (parentNode != null) {
            parentNode.removeChild(node);
        }

        // Remove from nested archives if present
        nestedArchives.remove(path);

        // Recursively delete children if present
        if (node.getChildren() != null) {
            final Set<Node> children = node.getChildren();

            // can't remove from collection inside of the iteration
            final Set<Node> childrenCopy = new HashSet<Node>(children);
            for (Node child : childrenCopy) {
                node.removeChild(child);
                content.remove(child.getPath());
            }
        }
        return content.remove(path);
    }
62794
public static NestedListContainer eliminateEmptyStructures( NestedListContainer nlc ){
		for(int i=nlc.size()-1; i>=0; i--){
			NestedList nl = nlc.getNestedList(i);
			if( nl.getClass()==NestedListContainer.class )
				eliminateEmptyStructures( (NestedListContainer)nl );
			
			if( nl.empty() )nlc.remove( nl );			
		}
		return nlc;
	}
812047
def remove_parents(bases):
    
    if len(bases) < 2:
        return bases
    remove_i = []
    bases = list(bases)
    for i, base in enumerate(bases):
        for j, other in enumerate(bases):
            # print(i, j, base, other, remove_i)
            if j != i and (issubclass(other, base) or base == other):
                remove_i.append(i)
    remove_i = set(remove_i)
    remove_i = [i for i in remove_i]
    remove_i.sort(reverse=True)
    for index in remove_i:
        try:
            del bases[index]
        except IndexError:
            print("Unable to delete base: ", bases)
    return bases
59051
public static <T> List<T> immutableListView(List<T> list) {
        if (list instanceof ImmutableList<?>) {
            return list;
        }
        if (list instanceof ArrayList<?>) {
            ArrayList.class.cast(list).trimToSize();
        }
        return Collections.unmodifiableList(list);
    }
1313117
public static List<Node> getParentChangeScopeNodes(List<Node> scopeNodes) {
    Set<Node> parentScopeNodes = new LinkedHashSet<>(scopeNodes);
    for (Node scopeNode : scopeNodes) {
      parentScopeNodes.add(getEnclosingChangeScopeRoot(scopeNode));
    }
    return new ArrayList<>(parentScopeNodes);
  }