def uproot(tree):
        """
        Take a subranch of a tree and deep-copy the children
        of this subbranch into a new LabeledTree
        """
        uprooted = tree.copy()
        uprooted.parent = None
        for child in tree.all_children():
            uprooted.add_general_child(child)
        return uprooted
def uproot ( tree ) : uprooted = tree . copy ( ) uprooted . parent = None for child in tree . all_children ( ) : uprooted . add_general_child ( child ) return uprooted
Take a subranch of a tree and deep-copy the children
        of this subbranch into a new LabeledTree