def plot_poly(ploty, poly):
    """
    Taken from the materials and modified.

    Returns a set of plotx points calulated from the polynomial and input ploty data.
    """

    fit_success = False

    try:
        plotx = poly[0]*ploty**2 + poly[1]*ploty + poly[2]
        fit_success = True
    except TypeError:
        # Avoids an error if poly is still none or incorrect
        print('The function failed to fit a line!')
        plotx = 1*ploty**2 + 1*ploty

    return plotx, fit_success