Do a recursive copy of the node list.
342448
def docCopyNodeList(self, doc):
        
        if doc is None: doc__o = None
        else: doc__o = doc._o
        ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o)
        if ret is None:raise treeError('xmlDocCopyNodeList() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
527815
def list(cls, name, parent=None, interleave=None):
        """"""
        node = cls.leaf_list(name, parent, interleave=interleave)
        node.keys = []
        node.keymap = {}
        return node
864294
def node_copy(node, nodefactory=Node):
    """"""
    return nodefactory(node.tag, node.attrib.copy(), node.text,
                       [node_copy(n, nodefactory) for n in node])
479976
def copy_node_info(src, dest):
    """"""
    for attr in ['lineno', 'fromlineno', 'tolineno',
                 'col_offset', 'parent']:
        if hasattr(src, attr):
            setattr(dest, attr, getattr(src, attr))
1189470
def visit_slice(self, node, parent):
        """"""
        newnode = nodes.Slice(parent=parent)
        newnode.postinit(
            _visit_or_none(node, "lower", self, newnode),
            _visit_or_none(node, "upper", self, newnode),
            _visit_or_none(node, "step", self, newnode),
        )
        return newnode
646073
def visit_listcomp(self, node, parent):
        """"""
        newnode = nodes.ListComp(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.elt, newnode),
            [self.visit(child, newnode) for child in node.generators],
        )
        return newnode
816584
def reparentChildren(self, newParent):
        
        # XXX - should this method be made more general?
        for child in self.childNodes:
            newParent.appendChild(child)
        self.childNodes = []
1315612
def flatten_list(node):
    
    flat_elems = []
    for elem in node:
        if elem == 'expr1024':
            for subelem in elem:
                assert subelem == 'expr32'
                for subsubelem in subelem:
                    flat_elems.append(subsubelem)
        elif elem == 'expr32':
            for subelem in elem:
                assert subelem == 'expr'
                flat_elems.append(subelem)
        else:
            flat_elems.append(elem)
            pass
        pass
    return flat_elems
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);
		}
	}
529908
def _reatach(self):
        """"""
        for item, p, idx in self._detached:
            # The item may have been deleted.
            if self.treeview.exists(item) and self.treeview.exists(p):
                self.treeview.move(item, p, idx)
        self._detached = []
855461
def recursive_update(a, b, **kwargs):
    
    copy = kwargs.get('copy', False)
    merge_lists = kwargs.get('merge_lists', True)

    for k, v in b.items():
        if isinstance(v, collections.Mapping):
            if isinstance(a.get(k, None), collections.Mapping):
                recursive_update(a[k], v, **kwargs)
                continue

        elif merge_lists and type(v) is list:
            if type(a.get(k, None)) is list:
                if copy:
                    a[k].extend(deepcopy(v))
                else:
                    a[k].extend(v)
                continue

        # warning, clobbering
        if copy:
            a[k] = deepcopy(v)
        else:
            a[k] = v

    return a
69856
def copy_node(node):
  """"""
  if not isinstance(node, gast.AST):
    return [copy_node(n) for n in node]
  new_node = copy.deepcopy(node)
  setattr(new_node, anno.ANNOTATION_FIELD,
          getattr(node, anno.ANNOTATION_FIELD, {}).copy())
  return new_node
1334283
def prepend(self, *nodes: Union[str, AbstractNode]) -> None:
        """"""
        node = _to_node_list(nodes)
        if self.firstChild:
            self.insertBefore(node, self.firstChild)
        else:
            self.appendChild(node)
756081
private void rechecksqlistpl()
    {
    	if(data != null)
    	{
    		Node[] childrens = ((SimpleNode)data).getChildren();
    		if(childrens != null && childrens.length > 0)
    		{
    			boolean switchcase = true;
    			for(Node node:childrens)
    			{
    				if(!(node instanceof ASTText))
    				{
    					switchcase = false;
    					break;
    				}
    			}
    			if(switchcase)
    			{
    				this.esInfo.setTpl(false);
    				 
    			}
    			else
    			{
    				this.esInfo.setTpl(true);
    			}
    		}
    		
    	}
    }
84531
def copyDoc(self, recursive):
        
        ret = libxml2mod.xmlCopyDoc(self._o, recursive)
        if ret is None:raise treeError('xmlCopyDoc() failed')
        __tmp = xmlDoc(_obj=ret)
        return __tmp
322531
def nodes_dump(self):
        """"""
        self._flush_nodes()
        for (graph, node, branch, turn,tick, extant) in self.sql('nodes_dump'):
            yield (
                self.unpack(graph),
                self.unpack(node),
                branch,
                turn,
                tick,
                bool(extant)
            )
1072631
private static List<WComponent> copyChildren(final List<WComponent> children) {
		ArrayList<WComponent> copy;

		if (children == null) {
			copy = new ArrayList<>(1);
		} else {
			copy = new ArrayList<>(children);
		}

		return copy;
	}