def get_rev_recon(tree, recon, stree):
    """
    Returns a reverse reconciliation

    A reverse reconciliation is a mapping from nodes in the species tree to
    lists of nodes in the gene tree.
    """
    rev_recon = {}
    nodes = set(tree.postorder())
    for node, snode in recon.iteritems():
        if node not in nodes:
            raise Exception("node '%s' not in tree" % node.name)
        rev_recon.setdefault(snode, []).append(node)
    return rev_recon