<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def random_polygon(segments=8, radius=1.0):
 """ Generate a random polygon with a maximum number of sides and approximate radius. Parameters --------- segments: int, the maximum number of sides the random polygon will have radius: float, the approximate radius of the polygon desired Returns --------- polygon: shapely.geometry.Polygon object with random exterior, and no interiors. """

    angles = np.sort(np.cumsum(np.random.random(
        segments) * np.pi * 2) % (np.pi * 2))
    radii = np.random.random(segments) * radius
    points = np.column_stack(
        (np.cos(angles), np.sin(angles))) * radii.reshape((-1, 1))
    points = np.vstack((points, points[0]))
    polygon = Polygon(points).buffer(0.0)
    if util.is_sequence(polygon):
        return polygon[0]
    return polygon