def _rename_node(self, name, new_name):
<EOL>if not self.is_root(name):<EOL><INDENT>parent = self._db[name]["<STR_LIT>"]<EOL>self._db[parent]["<STR_LIT>"].remove(name)<EOL>self._db[parent]["<STR_LIT>"] = sorted(<EOL>self._db[parent]["<STR_LIT>"] + [new_name]<EOL>)<EOL><DEDENT>iobj = self._get_subtree(name) if name != self.root_name else self.nodes<EOL>for key in iobj:<EOL><INDENT>new_key = key.replace(name, new_name, <NUM_LIT:1>)<EOL>new_parent = (<EOL>self._db[key]["<STR_LIT>"]<EOL>if key == name<EOL>else self._db[key]["<STR_LIT>"].replace(name, new_name, <NUM_LIT:1>)<EOL>)<EOL>self._db[new_key] = {<EOL>"<STR_LIT>": new_parent,<EOL>"<STR_LIT>": [<EOL>child.replace(name, new_name, <NUM_LIT:1>)<EOL>for child in self._db[key]["<STR_LIT>"]<EOL>],<EOL>"<STR_LIT:data>": copy.deepcopy(self._db[key]["<STR_LIT:data>"]),<EOL>}<EOL>del self._db[key]<EOL><DEDENT>if name == self.root_name:<EOL><INDENT>self._root = new_name<EOL>self._root_hierarchy_length = len(<EOL>self.root_name.split(self._node_separator)<EOL>)<EOL><DEDENT>
Rename node private method.

No argument validation and usage of getter/setter private methods is
used for speed