Return new tree with index removed.
774957
def remove(self, index):
        ''''''
        newtree = LookupTree()
        newtree.root = _remove_down(self.root, index, 0)
        return newtree
651921
def replace_nodes(root, old, new):

    '''
     
    '''

    rep = Replacer(old, new)
    rep.visit(root)
    return
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
931706
def remove(self, index):
        '''
        
        '''
        raise NotImplementedError
        if hasattr(index, '__iter__'):
            ind = set(index)
        else:
            ind = [index]

        # Rebuild relationships, excluding the provided indices
        self._relationships = [r for i, r in enumerate(self._relationships) if i not in ind]
163515
def remove(self, iterable, data=None):
        
        return self.root.remove(iterable, data=data)
1058742
def convert_tree(self, tree):
        
        nodeById = {}
        root_node = None
        node_list = _index_list_of_values(tree, 'node')
        for node in node_list:
            nodeById[node['@id']] = node
            r = node.get('@root')
            # _LOG.debug(' node {} @root={}'.format(node['@id'], r))
            if r in [True, 'true']:  # @TEMP accepting true or "true"
                assert root_node is None
                root_node = node
        assert root_node is not None
        edgeBySourceId = {}
        edge_list = _get_index_list_of_values(tree, 'edge')
        for edge in edge_list:
            sourceId = edge['@source']
            eid = edge['@id']
            del edge['@id']
            byso = edgeBySourceId.setdefault(sourceId, {})
            byso[eid] = edge
        # If all that succeeds, add the new object to the dict, creating a fat structure
        tree['nodeById'] = nodeById
        tree['edgeBySourceId'] = edgeBySourceId
        tree['^ot:rootNodeId'] = root_node['@id']
        # Make the struct leaner
        tid = tree['@id']
        if self.remove_old_structs:
            del tree['@id']
            del tree['node']
            try:
                del tree['edge']
            except:
                # Tree Tr75035 in http://treebase.org/treebase-web/search/study/summary.html?id=14763
                #   is empty. in NeXML that shows up as a tree with a node but no edges.
                #   See https://github.com/OpenTreeOfLife/opentree/issues/641
                # TODO: returning None seems safest, but could cull trees with just metadata.
                #       but creating a fake tree for metadata is ugly. So, I'm fine with not
                #       supporting this.
                _LOG.warn('Tree with ID "{}" is being dropped because it has no edges'.format(tid))
                assert not edge_list
                return None
            for node in node_list:
                if '^ot:isLeaf' in node:
                    del node['^ot:isLeaf']
                del node['@id']
        return tid, tree
377603
def remove_and_append(self, index):
        """"""
        while index in self:
            self.remove(index)
        self.append(index)
339781
def assoc(self, index, value):
        ''''''
        newnode = LookupTreeNode(index, value)
        newtree = LookupTree()
        newtree.root = _assoc_down(self.root, newnode, 0)
        return newtree
47234
def dispatch(self, tree):
        ""
        if isinstance(tree, list):
            for t in tree:
                self.dispatch(t)
            return
        meth = getattr(self, "_" + tree.__class__.__name__)
        meth(tree)
481346
public <V,T extends RiakIndex<V>> T removeIndex(RiakIndex.Name<T> name)
    {
        RiakIndex<?> removed = indexes.remove(name.getFullname());
        if (removed != null)
        {
            T index = name.wrap(removed).createIndex();
            return index;
        }
        else
        {
            return null;
        }
    }
745201
private T doRemove(int index) {
        keys[index]   = 0;
        states[index] = REMOVED;
        final Object previous = values[index];
        values[index] = missingEntries;
        --size;
        ++count;
        return (T)previous;
    }
1248335
def _remove_from_index(index, obj):
    """"""
    try:
        index.value_map[indexed_value(index, obj)].remove(obj.id)
    except KeyError:
        pass
1330694
def reset(self):
        
        if os.path.exists(self.index_dir):
            rmtree(self.index_dir)
        self.index = None
218904
def visit_delete(self, node, parent):
        """"""
        newnode = nodes.Delete(node.lineno, node.col_offset, parent)
        newnode.postinit([self.visit(child, newnode) for child in node.targets])
        return newnode
18105
function () {
                    var name, index = i;

                    if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
                        return new(tree.Variable)(name, index, env.currentFileInfo);
                    }
                }
318747
public void renameNodesInTree(String oldName, String newName) {
		List<Node> nodes = getNodesFromTreeByName(oldName);
		Iterator i = nodes.iterator();
		while (i.hasNext()) {
			Node n = (Node) i.next();
			n.setName(newName);
		}
	}
830648
async def delete_tree(self, prefix, *, separator=None):
        
        response = await self._discard(prefix,
                                       recurse=True,
                                       separator=separator)
        return response.body is True