<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plot_lines(x, fsamps, ax=None, downsample=100, **kwargs):
 """ Plot function samples as a set of line plots. Parameters x: 1D array-like x values to plot fsamps: 2D array-like set of functions to plot at each x. As returned by :func:`fgivenx.compute_samples` ax: axes object :class:`matplotlib.pyplot.ax` to plot on. downsample: int, optional Reduce the number of samples to a viewable quantity. (Default 100) any other keywords are passed to :meth:`matplotlib.pyplot.ax.plot` """

    if ax is None:
        ax = matplotlib.pyplot.gca()
    if downsample < len(fsamps.T):
        indices = numpy.random.choice(len(fsamps.T), downsample, replace=False)
    else:
        indices = numpy.arange(len(fsamps.T))
    color = kwargs.pop('color', 'k')
    alpha = kwargs.pop('alpha', 0.1)
    for y in fsamps.T[indices]:
        ax.plot(x, y, color=color, alpha=alpha, **kwargs)