def get_children_labels(self, treepos):
        """Given the treeposition of a node, return the labels of its children."""
        children_labels = []
        node = self.dgtree[treepos]
        for child in node:
            if is_leaf(child):
                # we can't call .label() on a leaf node
                children_labels.append(child)
            else:
                children_labels.append(child.label())
        return children_labels
def get_children_labels ( self , treepos ) : children_labels = [ ] node = self . dgtree [ treepos ] for child in node : if is_leaf ( child ) : children_labels . append ( child ) else : children_labels . append ( child . label ( ) ) return children_labels
Given the treeposition of a node, return the labels of its children.