Mark a node name as no longer in use.

        It could thus be recycled to name a new node.
7660
def free(self, kind, name):
        
        try:
            params = self._parse(name)
            index = int(params['index'], 10)
            self._free[kind].add(index)
            assert index <= self._top[kind]
            if index == self._top[kind]:
                self._top[kind] -= 1
        except ValueError:
            # ignore failures in self._parse()
            pass
643130
def _mark_in_progress(self, node_id):
        
        self.queued.remove(node_id)
        self.in_progress.add(node_id)
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);
		}
	}
651921
def replace_nodes(root, old, new):

    '''
     
    '''

    rep = Replacer(old, new)
    rep.visit(root)
    return
368102
void wipeDatanode(DatanodeID nodeID) throws IOException {
    String key = nodeID.getStorageID();
    host2DataNodeMap.remove(datanodeMap.remove(key));
    if (NameNode.stateChangeLog.isDebugEnabled()) {
      NameNode.stateChangeLog.debug(
        "BLOCK* NameSystem.wipeDatanode: "
          + nodeID.getName() + " storage " + key
          + " is removed from datanodeMap.");
    }
  }
244889
def del_label(self, name):
        """"""
        labels_tag = self.root[0]
        labels_tag.remove(self._find_label(name))
1111509
def replace(self, nodes, node):
        """"""
        nodes = nodes if isinstance(nodes, list) else [nodes]
        # Is the new node part of the replace nodes (i.e. want to collapse
        # a group of nodes into one of them)?
        collapse = self.id(node) in self.nodes
        # Add new node and edges
        if not collapse:
            self.add_node(node)
        for in_node in self.incoming(nodes):
            # TODO: check specifically for output_shape is not generic. Consider refactoring.
            self.add_edge(in_node, node, in_node.output_shape if hasattr(in_node, "output_shape") else None)
        for out_node in self.outgoing(nodes):
            self.add_edge(node, out_node, node.output_shape if hasattr(node, "output_shape") else None)
        # Remove the old nodes
        for n in nodes:
            if collapse and n == node:
                continue
            self.remove(n)
84290
def mark_as_inactive(self, kid):
        
        k = self.get_key_with_kid(kid)
        k.inactive_since = time.time()
806234
def node_label_present(
        name,
        node,
        value,
        **kwargs):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    labels = __salt__['kubernetes.node_labels'](node, **kwargs)

    if name not in labels:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'The label is going to be set'
            return ret
        __salt__['kubernetes.node_add_label'](label_name=name,
                                              label_value=value,
                                              node_name=node,
                                              **kwargs)
    elif labels[name] == value:
        ret['result'] = True
        ret['comment'] = 'The label is already set and has the specified value'
        return ret
    else:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'The label is going to be updated'
            return ret

        ret['comment'] = 'The label is already set, changing the value'
        __salt__['kubernetes.node_add_label'](
            node_name=node,
            label_name=name,
            label_value=value,
            **kwargs)

    old_labels = copy.copy(labels)
    labels[name] = value

    ret['changes']['{0}.{1}'.format(node, name)] = {
        'old': old_labels,
        'new': labels}
    ret['result'] = True

    return ret
573477
def cleanup(self):
        
        now = time.time()
        expired = now - NODE_TIMEOUT
        if self.conn.zremrangebyscore(self.key, 0, expired):
            self._notify()
640596
def visit_Name(self, node):
        
        return self.add(node, self.result[node.id])
538929
def forget(self, node=None, cache_directory=None):
        '''
        
        '''
        #plan.forget(node) clears only the cache for the given node (which may be a node name) and
        #  all nodes that depend on it; plan.forget(None) is equivalent to plan.forget()
        #plan.forget(node, cache_directory) additionally deletes all directories in the given cache
        #  directory that correspond to the nodes downstream of node. The node may be None to delete
        #  all relevant cache directories.
        m = self._memoized_data
        self._memoized_data = {}
        return m
542357
def remove_node(self, node):
        

        if node in self._nodes:
            yield from node.delete()
            self._nodes.remove(node)
2611
def node_name(node):
    
    return hasattr(node, 'id') and node.id or hasattr(node, 'name') and node.name
653683
def _clean(self):
        """"""
        found_ids = {}
        nodes = [self._nodes[_node.Root.ID]]
        while nodes:
            node = nodes.pop()
            found_ids[node.id] = None
            nodes = nodes + node.children

        for node_id in self._nodes:
            if node_id in found_ids:
                continue
            logger.error('Dangling node: %s', node_id)

        for node_id in found_ids:
            if node_id in self._nodes:
                continue
            logger.error('Unregistered node: %s', node_id)
646554
def note_deletion(self, key):
        
        # If we'rew deleting a key we previously added, then there is no diff
        if key in self._added:
            self._added.remove(key)
        else:
            # If the deleted key was previously changed, use the original value
            if key in self._previous:
                self._deleted[key] = self._previous[key]
                del self._previous[key]
            else:
                self._deleted[key] = self._instance[key]
41090
def node_name(self, value):
        
        if value == self._defaults['ai.internal.nodeName'] and 'ai.internal.nodeName' in self._values:
            del self._values['ai.internal.nodeName']
        else:
            self._values['ai.internal.nodeName'] = value