def commonancestors(*nodes):
ancestors = [node.ancestors for node in nodes]<EOL>common = []<EOL>for parentnodes in zip(*ancestors):<EOL><INDENT>parentnode = parentnodes[<NUM_LIT:0>]<EOL>if all([parentnode is p for p in parentnodes[<NUM_LIT:1>:]]):<EOL><INDENT>common.append(parentnode)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return tuple(common)<EOL>
Determine common ancestors of `nodes`.

>>> from anytree import Node
>>> udo = Node("Udo")
>>> marc = Node("Marc", parent=udo)
>>> lian = Node("Lian", parent=marc)
>>> dan = Node("Dan", parent=udo)
>>> jet = Node("Jet", parent=dan)
>>> jan = Node("Jan", parent=dan)
>>> joe = Node("Joe", parent=dan)

>>> commonancestors(jet, joe)
(Node('/Udo'), Node('/Udo/Dan'))
>>> commonancestors(jet, marc)
(Node('/Udo'),)
>>> commonancestors(jet)
(Node('/Udo'), Node('/Udo/Dan'))
>>> commonancestors()
()