def scale_poly(poly, scale):
    """Converts polygons and lists of polygons by scaling their
       coordinates. Works recursively on lists of polygons."""
    if type(poly) != list: return poly*scale
    return list(scale_poly(p, scale) for p in poly)