def return_small_clade(treenode):
node = treenode<EOL>while <NUM_LIT:1>:<EOL><INDENT>if node.children:<EOL><INDENT>c1, c2 = node.children<EOL>node = sorted([c1, c2], key=lambda x: len(x.get_leaves()))[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return node<EOL><DEDENT><DEDENT>
used to produce balanced trees, returns a tip node from the smaller clade