Translate a rename node into SQLQuery.
        :param node: a treebrd node
        :return: a SQLQuery object for the tree rooted at node
430683
def rename(self, node):
        
        child_object = self.translate(node.child)
        from_block = '({child}) AS {name}({attributes})'.format(
            child=child_object.to_sql(), name=node.name,
            attributes=', '.join(node.attributes.names))
        return self.query(str(node.attributes), from_block=from_block)
751776
def replace(self, new_node):
        """"""
        cur_node = self.cur_node
        nodestack = self.nodestack
        cur = nodestack.pop()
        prev = nodestack[-1]
        index = prev[-1] - 1
        oldnode, name = prev[-2][index]
        assert cur[0] is cur_node is oldnode, (cur[0], cur_node, prev[-2],
                                               index)
        parent = prev[0]
        if isinstance(parent, list):
            parent[index] = new_node
        else:
            setattr(parent, name, new_node)
503071
def filter(n: Node, query: str) -> CompatNodeIterator:
    
    ctx = uast()
    return CompatNodeIterator(NodeIterator(ctx.filter(query, n.internal_node), ctx))
495800
def rename(self, dn: str, new_rdn: str, new_base_dn: Optional[str] = None) -> None:
        

        return self._do_with_retry(
            lambda obj: obj.rename_s(dn, new_rdn, new_base_dn))
819133
def visit_Name(self, node):
        
        if node.id in self.symbols:
            symbol = path_to_node(self.symbols[node.id])
            if not getattr(symbol, 'isliteral', lambda: False)():
                parent = self.ancestors[node][-1]
                blacklist = (ast.Tuple,
                             ast.List,
                             ast.Set,
                             ast.Return)
                if isinstance(parent, blacklist):
                    raise PythranSyntaxError(
                        "Unsupported module identifier manipulation",
                        node)
            new_node = path_to_attr(self.symbols[node.id])
            new_node.ctx = node.ctx
            ast.copy_location(new_node, node)
            return new_node
        return node
992921
def query(self, name, node):
        
        #log.debug('searching schema for (%s)', name)
        qref = qualify(name, node, node.namespace())
        query = BlindQuery(qref)
        result = query.execute(self.schema)
        return (result, [])
317098
def replaceNode(self, cur):
        
        if cur is None: cur__o = None
        else: cur__o = cur._o
        ret = libxml2mod.xmlReplaceNode(self._o, cur__o)
        if ret is None:raise treeError('xmlReplaceNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
497580
def start_node(self):
        
        return db.cypher_query("MATCH (aNode) "
                               "WHERE id(aNode)={nodeid} "
                               "RETURN aNode".format(nodeid=self._start_node_id),
                               resolve_objects = True)[0][0][0]
551310
def relation(self, node):
        
        return self.query(select_block=str(node.attributes),
                          from_block=node.name)
852640
def _nodes(self, tree):
        
        def recourse(temp_tree_, nodes):
            if isinstance(temp_tree_, dict):
                if temp_tree_['split'] != -1:
                    nodes.append(temp_tree_['node'])
                    if temp_tree_['split'] != -1:
                        for k in ['sl', 'sr']:
                            recourse(temp_tree_[k], nodes)
            return None

        nodes_ = []
        recourse(tree, nodes_)
        return nodes_
439574
def extract_subtree(self, node):
        '''
        '''
        if not isinstance(node, Node):
            raise TypeError("node must be a Node")
        r = self.root; self.root = node; o = copy(self); self.root = r; return o
579274
def compile(self, node, *args, **kwargs):
        """"""
        if isinstance(node, WhereNode):
            return where_node_as_ldap(node, self, self.connection)
        return super(SQLCompiler, self).compile(node, *args, **kwargs)
89624
def copyNode(self, node, extended):
        
        if node is None: node__o = None
        else: node__o = node._o
        ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended)
        if ret is None:raise treeError('xmlDocCopyNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
698495
def select(self, node):
        

        child_object = self.translate(node.child)
        where_block = node.conditions
        if child_object.where_block:
              where_block = '({0}) AND ({1})'\
                  .format(child_object.where_block, node.conditions)
        child_object.where_block = where_block
        if not child_object.select_block:
            child_object.select_block = str(node.attributes)
        return child_object
1056072
function fromQueryNode(query) {
  var node = query.attrs.node.split('#')[0];
  var caps = new Caps(node);
  var identities = query.getChildren('identity');
  var features = query.getChildren('feature');

  identities.forEach(function(id) {
    caps.addIdentity(id.attrs.category, id.attrs.type, id.attrs.name, id.attrs.lang);
  });
  features.forEach(function(feature) {
    caps.addFeature(feature.attrs.var);
  });

  return caps;
}
852061
def visit(self, node):
        
        for pattern, replace in know_pattern:
            check = Check(node, dict())
            if check.visit(pattern):
                node = PlaceholderReplace(check.placeholders).visit(replace())
                self.update = True
        return super(PatternTransform, self).visit(node)
580499
def remodelTreeRemovingRoot(root, node):
    
    import bioio
    assert root.traversalID.mid != node
    hash = {}
    def fn(bT):
        if bT.traversalID.mid == node:
            assert bT.internal == False
            return [ bT ]
        elif bT.internal:
            i = fn(bT.left)
            if i is None:
                i = fn(bT.right)
            if i is not None:
                hash[i[-1]]= bT
                i.append(bT)
            return  i
        return None
    l = fn(root)
    def fn2(i, j):
        if i.left == j:
            return i.right
        assert i.right == j
        return i.left
    def fn3(bT):
        if hash[bT] == root:
            s = '(' + bioio.printBinaryTree(fn2(hash[bT], bT), bT, True)[:-1] + ')'
        else:
            s = '(' + bioio.printBinaryTree(fn2(hash[bT], bT), bT, True)[:-1] + ',' + fn3(hash[bT]) + ')'
        return s + ":" + str(bT.distance)
    s = fn3(l[0]) + ';'
    t = bioio.newickTreeParser(s)
    return t