def set_outgroup(self, outgroup):
outgroup = _translate_nodes(self, outgroup)<EOL>if self == outgroup:<EOL><INDENT>raise TreeError("<STR_LIT>")<EOL><DEDENT>parent_outgroup = outgroup.up<EOL>n = outgroup<EOL>while n.up is not self:<EOL><INDENT>n = n.up<EOL><DEDENT>self.children.remove(n)<EOL>if len(self.children) != <NUM_LIT:1>:<EOL><INDENT>down_branch_connector = self.__class__()<EOL>down_branch_connector.dist = <NUM_LIT:0.0><EOL>down_branch_connector.support = n.support<EOL>for ch in self.get_children():<EOL><INDENT>down_branch_connector.children.append(ch)<EOL>ch.up = down_branch_connector<EOL>self.children.remove(ch)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>down_branch_connector = self.children[<NUM_LIT:0>]<EOL><DEDENT>quien_va_ser_padre = parent_outgroup<EOL>if quien_va_ser_padre is not self:<EOL><INDENT>quien_va_ser_hijo = quien_va_ser_padre.up<EOL>quien_fue_padre = None<EOL>buffered_dist = quien_va_ser_padre.dist<EOL>buffered_support = quien_va_ser_padre.support<EOL>while quien_va_ser_hijo is not self:<EOL><INDENT>quien_va_ser_padre.children.append(quien_va_ser_hijo)<EOL>quien_va_ser_hijo.children.remove(quien_va_ser_padre)<EOL>buffered_dist2 = quien_va_ser_hijo.dist<EOL>buffered_support2 = quien_va_ser_hijo.support<EOL>quien_va_ser_hijo.dist = buffered_dist<EOL>quien_va_ser_hijo.support = buffered_support<EOL>buffered_dist = buffered_dist2<EOL>buffered_support = buffered_support2<EOL>quien_va_ser_padre.up = quien_fue_padre<EOL>quien_fue_padre = quien_va_ser_padre<EOL>quien_va_ser_padre = quien_va_ser_hijo<EOL>quien_va_ser_hijo = quien_va_ser_padre.up<EOL><DEDENT>quien_va_ser_padre.children.append(down_branch_connector)<EOL>down_branch_connector.up = quien_va_ser_padre<EOL>quien_va_ser_padre.up = quien_fue_padre<EOL>down_branch_connector.dist += buffered_dist<EOL>outgroup2 = parent_outgroup<EOL>parent_outgroup.children.remove(outgroup)<EOL>outgroup2.dist = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>outgroup2 = down_branch_connector<EOL><DEDENT>outgroup.up = self<EOL>outgroup2.up = self<EOL>self.children = [outgroup,outgroup2]<EOL>middist = (outgroup2.dist + outgroup.dist)/<NUM_LIT:2><EOL>outgroup.dist = middist<EOL>outgroup2.dist = middist<EOL>outgroup2.support = outgroup.support<EOL>
Sets a descendant node as the outgroup of a tree.  This function
can be used to root a tree or even an internal node.

Parameters:
-----------
outgroup: 
    a node instance within the same tree structure that will be 
    used as a basal node.