def copy_tree(t):
    'Returns a copy of t. Only for testing purposes.\n\n    >>> t = tree(5)\n    >>> copy = copy_tree(t)\n    >>> t = tree(6)\n    >>> print_tree(copy)\n    5\n    '
    return tree(label(t), [copy_tree(b) for b in branches(t)])
Returns a copy of t. Only for testing purposes.

>>> t = tree(5)
>>> copy = copy_tree(t)
>>> t = tree(6)
>>> print_tree(copy)
5
def copy_tree(t):
    'Returns a copy of t. Only for testing purposes.\n\n    >>> t = tree(5)\n    >>> copy = copy_tree(t)\n    >>> t = tree(6)\n    >>> print_tree(copy)\n    5\n    '
    return tree(label(t), [copy_tree(b) for b in branches(t)])