def delete(self, prevent_nondicotomic=True, preserve_branch_length=False):
parent = self.up<EOL>if parent:<EOL><INDENT>if preserve_branch_length:<EOL><INDENT>if len(self.children) == <NUM_LIT:1>:<EOL><INDENT>self.children[<NUM_LIT:0>].dist += self.dist<EOL><DEDENT>elif len(self.children) > <NUM_LIT:1>:<EOL><INDENT>parent.dist += self.dist<EOL><DEDENT><DEDENT>for ch in self.children:<EOL><INDENT>parent.add_child(ch)<EOL><DEDENT>parent.remove_child(self)<EOL><DEDENT>if prevent_nondicotomic and parent andlen(parent.children) < <NUM_LIT:2>:<EOL><INDENT>parent.delete(prevent_nondicotomic=False,<EOL>preserve_branch_length=preserve_branch_length)<EOL><DEDENT>
Deletes node from the tree structure. Notice that this method
makes 'disappear' the node from the tree structure. This means
that children from the deleted node are transferred to the
next available parent.

Parameters:
-----------
prevent_nondicotomic: 
    When True (default), delete
    function will be execute recursively to prevent single-child
    nodes.

preserve_branch_length: 
    If True, branch lengths of the deleted nodes are transferred 
    (summed up) to its parent's branch, thus keeping original 
    distances among nodes.

**Example:**
        / C
  root-|
       |        / B
        \--- H |
                \ A

  > H.delete() will produce this structure:

        / C
       |
  root-|--B
       |
        \ A