Return the complete string from the tree root up to and including this node
 i.e. The total string key for this node from root.
9234
def to_s
      st = @char
      node = self
      while node != nil
        node = node.up
        break if node==nil
        st = node.char+st
      end
      st
    end
587597
def etree_to_string(tree):
        
        buff = BytesIO()
        tree.write(buff, xml_declaration=True, encoding='UTF-8')
        return buff.getvalue()
993306
def hash_full_tree(self, leaves):
        """"""
        root_hash, hashes = self._hash_full(leaves, 0, len(leaves))
        assert len(hashes) == count_bits_set(len(leaves))
        assert (self._hash_fold(hashes) == root_hash if hashes else
                root_hash == self.hash_empty())
        return root_hash
944073
def toDict(self):
		

		# Init the dictionary we will return
		dRet = {}

		# Add the hash key
		dRet['__hash__'] = self._key.toDict()

		# Get the parents dict and add it to the return
		dRet.update(super(HashNode,self).toDict())

		# Get the nodes dict and also add it to the return
		dRet.update(self._node.toDict())

		# Return
		return dRet
965659
def _get_whole_subtrees(self):
        
        subtrees = []
        loose_leaves = len(self.leaves) - 2**int(log(len(self.leaves), 2))
        the_node = self.root
        while loose_leaves:
            subtrees.append(the_node.l)
            the_node = the_node.r
            loose_leaves = loose_leaves - 2**int(log(loose_leaves, 2))
        subtrees.append(the_node)
        return subtrees
674027
@SuppressWarnings( "unchecked" )
    public <V> Key<V> getRoot() {
        if ( this.getParent() == null ) {
            return (Key<V>) this;
        } else {
            return this.getParent().getRoot();
        }
    }
800700
def _tree_to_string(cls, root_element, xml_declaration=True, pretty_print=True):
        
        from lxml import etree
        return gf.safe_unicode(etree.tostring(
            root_element,
            encoding="UTF-8",
            method="xml",
            xml_declaration=xml_declaration,
            pretty_print=pretty_print
        ))
813934
@Override
    protected String getRoot() {
        JsonObject result = ((JsonObject) new JsonParser().parse(raw));
        String root = null;
        for(Map.Entry<String, JsonElement> member : result.entrySet()) {
            root = member.getKey();
        }
        return root;
    }
753156
public String wholeText() {
        final StringBuilder accum = StringUtil.borrowBuilder();
        NodeTraversor.traverse(new NodeVisitor() {
            public void head(Node node, int depth) {
                if (node instanceof TextNode) {
                    TextNode textNode = (TextNode) node;
                    accum.append(textNode.getWholeText());
                }
            }

            public void tail(Node node, int depth) {
            }
        }, this);

        return StringUtil.releaseBuilder(accum);
    }
1291253
def _complete_string(key, haystack):
    

    if len(key) == 0:
        return haystack

    match = []
    for straw in haystack:
        if string.find(straw, key) == 0:
            match.append(straw)
    return match
1103306
def _get_full_output(node, for_output=False):
    '''
    
    '''
    ret = {}
    for item in six.iterkeys(node):
        value = node[item]
        if value is not None and for_output:
            value = six.text_type(value)
        ret[item] = value
    return ret
330433
def tree_to_str(root):
    

    xs = []
    for value, node, depth in iter_tree(root):
        template = "{indent}"
        if node is not root:
            template += "case={value}\t"
        if node.attribute is None:
            template += "result={result} -- P={prob:.2}"
        else:
            template += "split by {split}:\t" +\
                        "(partial result={result} -- P={prob:.2})"
        line = template.format(indent="    " * depth,
                               value=value,
                               result=node.result[0],
                               prob=node.result[1],
                               split=str(node.attribute))
        xs.append(line)
    return "\n".join(xs)
1247923
def get_root(self):
        """"""
        if self.is_root_node():
            return self

        return self.get_ancestors().order_by(
            "-%s__depth" % self._closure_parentref()
        )[0]
191908
def _get(self, key: bytes) -> Tuple[bytes, Tuple[Hash32]]:
        
        validate_is_bytes(key)
        validate_length(key, self._key_size)
        branch = []

        target_bit = 1 << (self.depth - 1)
        path = to_int(key)
        node_hash = self.root_hash
        # Append the sibling node to the branch
        # Iterate on the parent
        for _ in range(self.depth):
            node = self.db[node_hash]
            left, right = node[:32], node[32:]
            if path & target_bit:
                branch.append(left)
                node_hash = right
            else:
                branch.append(right)
                node_hash = left
            target_bit >>= 1

        # Value is the last hash in the chain
        # NOTE: Didn't do exception here for testing purposes
        return self.db[node_hash], tuple(branch)
842035
private StringTreeNode getOrgHierarchyTree() {
		// Hierarchical data in a flat format.
		// If an Object array contains 1 String element, it is a leaf node.
		// Else an Object array contains 1 String element + object arrays and is a branch node.
		Object[] data = new Object[]{
			"Australia",
			new Object[]{"ACT"},
			new Object[]{
				"NSW",
				new Object[]{"Paramatta"},
				new Object[]{
					"Sydney",
					new Object[]{
						"Branch 1",
						new Object[]{"Processing Team 1"},
						new Object[]{
							"Processing Team 2",
							new Object[]{"Robert Rogriguez"},
							new Object[]{"Phillip Sedgwick"},
							new Object[]{"Donald Sullivan"},
							new Object[]{"All"}
						},
						new Object[]{
							"Processing Team 3",
							new Object[]{"Jim McCarthy"},
							new Object[]{"Peter Dunne"},
							new Object[]{"Nicole Brown"},
							new Object[]{"All"}
						},
						new Object[]{"Processing Team 4"},
						new Object[]{"Processing Team 5"},
						new Object[]{"All"}
					},
					new Object[]{"Branch 2"},
					new Object[]{"Branch 3"}
				},
				new Object[]{"Broken Hill"},
				new Object[]{"Tamworth"},
				new Object[]{"Griffith"},
				new Object[]{"Wollongong"},
				new Object[]{"Port Macquarie"},
				new Object[]{"Moree"},
				new Object[]{"Orange"},
				new Object[]{"Richmond"},
				new Object[]{"Bathurst"},
				new Object[]{"Newcastle"},
				new Object[]{"Nowra"},
				new Object[]{"Woy Woy"},
				new Object[]{"Maitland"},
				new Object[]{"Hay"},
				new Object[]{"Bourke"},
				new Object[]{"Lightning Ridge"},
				new Object[]{"Coffs Harbour"},
				new Object[]{"All"}
			},
			new Object[]{
				"VIC",
				new Object[]{"Melbourne"},
				new Object[]{"Wangaratta"},
				new Object[]{"Broken Hill"},
				new Object[]{"Albury"},
				new Object[]{"Ballarat"},
				new Object[]{"Bendigo"},
				new Object[]{"Horsham"},
				new Object[]{"Portland"},
				new Object[]{"Geelong"},
				new Object[]{"Shepparton"},
				new Object[]{"Hamilton"},
				new Object[]{"Morewell"}
			},
			new Object[]{"SA"},
			new Object[]{"NT"},
			new Object[]{"QLD"},
			new Object[]{"WA"},
			new Object[]{"TAS"}
		};

		return buildOrgHierarchyTree(data);
	}
466843
def complete_sum(self):
        
        node = self.node.complete_sum()
        if node is self.node:
            return self
        else:
            return _expr(node)
324562
def to_string(self):
        """"""
        root = etree.Element('urlset', nsmap={None: SITEMAP_NS})
        for url in self.urls:
            url.generate(root)
        return etree.tostring(root, pretty_print=True, xml_declaration=True,
                              encoding='utf-8')