def get_farthest_node(self, topology_only=False):
<EOL>farthest_node, farthest_dist = self.get_farthest_leaf(<EOL>topology_only=topology_only)<EOL>prev = self<EOL>cdist = <NUM_LIT:0.0> if topology_only else prev.dist<EOL>current = prev.up<EOL>while current is not None:<EOL><INDENT>for ch in current.children:<EOL><INDENT>if ch != prev:<EOL><INDENT>if not ch.is_leaf():<EOL><INDENT>fnode, fdist = ch.get_farthest_leaf(<EOL>topology_only=topology_only)<EOL><DEDENT>else:<EOL><INDENT>fnode = ch<EOL>fdist = <NUM_LIT:0><EOL><DEDENT>if topology_only:<EOL><INDENT>fdist += <NUM_LIT:1.0><EOL><DEDENT>else:<EOL><INDENT>fdist += ch.dist<EOL><DEDENT>if cdist+fdist > farthest_dist:<EOL><INDENT>farthest_dist = cdist + fdist<EOL>farthest_node = fnode<EOL><DEDENT><DEDENT><DEDENT>prev = current<EOL>if topology_only:<EOL><INDENT>cdist += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>cdist  += prev.dist<EOL><DEDENT>current = prev.up<EOL><DEDENT>return farthest_node, farthest_dist<EOL>
Returns the node's farthest descendant or ancestor node, and the
distance to it.

:argument False topology_only: If set to True, distance
  between nodes will be referred to the number of nodes
  between them. In other words, topological distance will be
  used instead of branch length distances.

:return: A tuple containing the farthest node referred to the
  current node and the distance to it.