Tree: inin A recursave tree data structure. Note the retationship between this class and Recursivelist; the only major difference is that rest has been replaced by _ subtrees to handte multiple recursive sub-parts. Hen \# wa Private Attributes =m= \# The item stored at this tree's root, or None if the tree is enpty. root: optional [Anyl \# The list of alt subtrees of this tree. - subtrees: List [Tree] \# mum Representation Invariants === \# - If self. root is None then self. subtrees is an enpty list. This setting of attributes represents an enpty Tree. Note: self. _ subtrees may be empty when selt._root is not None. This setting of attributes represents a tree consisting of just one node. def swap_down(setf) None: "*=Swap the root of this Tree with the frargest of its chitdren until the originat root's value is at a position where it's larger than or equal to all of its children. In the case of a tie, swap with the one that cones first in subtrees. >t= Tree(1, [1)tsswapdownt) print(t) \& No swaps are made 1 t._subtrees =[Tree(2,[1]. Tree (3, [1)] print(t) 1 3233> t. 5wapdown() ss print (t) in 1 swapped with 3 3 2 1 t-large =Tree(3,ITree(5,ITree(7,tTree(2,11), Tree(1, [1]) 1), 1) Tree (4, [1] 1]> print (t __targe) 3 7 2 1 mos targe-swap_down( ) print(t_large) =3 swapped with 5 , and then with 7 . \# The beton are methods given to you. Do NoT change these. def init_(self, root: Any, subtrees: List (Treel) None: wanitiatize a new Tree with the given root vatue and subtrees. If eroots is None, the tree is eapty. Preconditiont if sroot> is None, then ksubtreess is enpty. self, _root =root self.-subtrees = subtrees def is empty(self boolt nHinReturn True if this tree is enty. t1=Trec( None, [1)t1.15 _etopty() True t2=Tree(3,11) t2.1s_empty () Fatise winl return self,_root is None det _str (sett) str: \# The below are nethods given to you. Do NoT change these. def _init (self, root: Any, subtrees: List(TreeJ) Wonet "anitialize a new Tree with the given root value and subtrees. If eroot> is None, the tree is empty. Precondition: if is None, then esubtrees> is empty. ren self root = root self._subtrees: = subtrees def is empty (self) bool: wawpeturn True if this tree is empty. tI= Tree (None, []) t1,is_empty () True >t2=Tree(3, [1) > t2.is_empty ( ) False a return self. root is None def _str_ ( self f str: m*Return a string representation of this: tree. For each node, its iten is printed before any of its descendants' items. The output is nicely indented. You may find this method helpful for debugging. return self._str_indented () , steip( ) def str_indented(setf, depth: int =0) str: in*peturn an indented string representation of this-tree. The indentation level is: specified by the : return e tiset 5=1+ depth + str (set( root )+ ' ln3 for subtree in self . subtrees: * Note that the "depth' argument to the recursive catl is \# modified. 5+= subtree. _str_indented(depth + 1) returnis if nane _ingort doctest doctest. testmod (1) import python_ta.