def map_pred_edges(pred_edges, mapping):
    """
    Returns a new list of edges where the segment id is remapped based
    on the provided dictionary.
    """
    return list((mapping[edge[0]], edge[1], edge[2]) for edge in pred_edges)