<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def line_plot(data, atts=None, percent=100.0, seed=1, title=None, outfile=None, wait=True):
 """ Uses the internal format to plot the dataset, one line per instance. :param data: the dataset :type data: Instances :param atts: the list of 0-based attribute indices of attributes to plot :type atts: list :param percent: the percentage of the dataset to use for plotting :type percent: float :param seed: the seed value to use for subsampling :type seed: int :param title: an optional title :type title: str :param outfile: the (optional) file to save the generated plot to. The extension determines the file format. :type outfile: str :param wait: whether to wait for the user to close the plot :type wait: bool """

    if not plot.matplotlib_available:
        logger.error("Matplotlib is not installed, plotting unavailable!")
        return

    # create subsample
    data = plot.create_subsample(data, percent=percent, seed=seed)

    fig = plt.figure()

    if atts is None:
        x = []
        for i in range(data.num_attributes):
            x.append(i)
    else:
        x = atts

    ax = fig.add_subplot(111)
    ax.set_xlabel("attributes")
    ax.set_ylabel("value")
    ax.grid(True)
    for index_y in range(data.num_instances):
        y = []
        for index_x in x:
            y.append(data.get_instance(index_y).get_value(index_x))
        ax.plot(x, y, "o-", alpha=0.5)
    if title is None:
        title = data.relationname
    if percent != 100:
        title += " (%0.1f%%)" % percent
    fig.canvas.set_window_title(title)
    plt.draw()
    if outfile is not None:
        plt.savefig(outfile)
    if wait:
        plt.show()