def get_local_node_mapping(tree, last_tree, spr):
    """
    Determine the mapping between nodes in local trees across ARG.

    A maps across local trees until it is broken (parent of recomb node).
    This method assumes tree and last_tree share the same node naming
    and do not contain intermediary nodes (i.e. single lineages).
    """
    if last_tree is None:
        # no mapping if last_tree is None
        return None

    else:
        (rname, rtime), (cname, ctime) = spr

        # assert ARG is SMC-style (no bubbles)
        assert rname != cname

        # recomb_parent is broken and does not map to anyone
        recomb_parent = last_tree[rname].parents[0]
        mapping = dict((node.name, node.name) for node in last_tree)
        mapping[recomb_parent.name] = None
        return mapping