def resolve_polytomy(self, <EOL>default_dist=<NUM_LIT:0.0>, <EOL>default_support=<NUM_LIT:0.0>,<EOL>recursive=True):
def _resolve(node):<EOL><INDENT>if len(node.children) > <NUM_LIT:2>:<EOL><INDENT>children = list(node.children)<EOL>node.children = []<EOL>next_node = root = node<EOL>for i in range(len(children) - <NUM_LIT:2>):<EOL><INDENT>next_node = next_node.add_child()<EOL>next_node.dist = default_dist<EOL>next_node.support = default_support<EOL><DEDENT>next_node = root<EOL>for ch in children:<EOL><INDENT>next_node.add_child(ch)<EOL>if ch != children[-<NUM_LIT:2>]:<EOL><INDENT>next_node = next_node.children[<NUM_LIT:0>]<EOL><DEDENT><DEDENT><DEDENT><DEDENT>target = [self]<EOL>if recursive:<EOL><INDENT>target.extend([n for n in self.get_descendants()])<EOL><DEDENT>for n in target:<EOL><INDENT>_resolve(n)<EOL><DEDENT>
Resolve all polytomies under current node by creating an
arbitrary dicotomic structure among the affected nodes. This
function randomly modifies current tree topology and should
only be used for compatibility reasons (i.e. programs
rejecting multifurcated node in the newick representation).

:param 0.0 default_dist: artificial branch distance of new
    nodes.

:param 0.0 default_support: artificial branch support of new
    nodes.

:param True recursive: Resolve any polytomy under this
     node. When False, only current node will be checked and fixed.