def get_points_to_poly_assignments(poly_to_pt_assignments):
    """
    Reverse of poly to points assignments: Returns a list of size N, which is the number of points in
    `poly_to_pt_assignments`. Each list element is a index into the list of Voronoi regions.
    """
    pt_poly = [(i_pt, i_vor)
               for i_vor, pt_indices in enumerate(poly_to_pt_assignments)
               for i_pt in pt_indices]

    return [i_vor for _, i_vor in sorted(pt_poly, key=lambda x: x[0])]