def get_common_ancestor(self, *target_nodes, **kargs):
get_path = kargs.get("<STR_LIT>", False)<EOL>if len(target_nodes) == <NUM_LIT:1> and type(target_nodes[<NUM_LIT:0>])in set([set, tuple, list, frozenset]):<EOL><INDENT>target_nodes = target_nodes[<NUM_LIT:0>]<EOL><DEDENT>target_nodes = _translate_nodes(self, *target_nodes)<EOL>if type(target_nodes) != list:<EOL><INDENT>target_nodes = [target_nodes, self]<EOL><DEDENT>n2path = {}<EOL>reference = []<EOL>ref_node = None<EOL>for n in target_nodes:<EOL><INDENT>current = n<EOL>while current:<EOL><INDENT>n2path.setdefault(n, set()).add(current)<EOL>if not ref_node:<EOL><INDENT>reference.append(current)<EOL><DEDENT>current = current.up<EOL><DEDENT>if not ref_node:<EOL><INDENT>ref_node = n<EOL><DEDENT><DEDENT>common = None<EOL>for n in reference:<EOL><INDENT>broken = False<EOL>for node, path in six.iteritems(n2path):<EOL><INDENT>if node is not ref_node and n not in path:<EOL><INDENT>broken = True<EOL>break<EOL><DEDENT><DEDENT>if not broken:<EOL><INDENT>common = n<EOL>break<EOL><DEDENT><DEDENT>if not common:<EOL><INDENT>raise TreeError("<STR_LIT>")<EOL><DEDENT>if get_path:<EOL><INDENT>return common, n2path<EOL><DEDENT>else:<EOL><INDENT>return common<EOL><DEDENT>
Returns the first common ancestor between this node and a given
list of 'target_nodes'.

**Examples:**
  t = tree.Tree("(((A:0.1, B:0.01):0.001, C:0.0001):1.0[&&NHX:name=common], (D:0.00001):0.000001):2.0[&&NHX:name=root];")
  A = t.get_descendants_by_name("A")[0]
  C = t.get_descendants_by_name("C")[0]
  common =  A.get_common_ancestor(C)
  print common.name