def METHOD_NAME(peak, keep_amplitude_per_sample=False):
    """
    Creates x,y coordinates needed to draw peaks via
    bokeh.models.patches.
    :param peak: Peak for which we need the x/y samples
    :param keep_amplitude_per_sample: If y-data should be in units of "per sample"
        or "per ns".
    :returns: Tuple of x, y
    """
    if keep_amplitude_per_sample:
        dt_a = 1
    else:
        dt_a = peak['dt']
    x = np.arange(peak["length"])
    xx = np.zeros(2 * len(x), dtype=x.dtype)
    mx = 0.5 * (x[1::] + x[:-1])
    xx[1:-1:2] = mx
    xx[2::2] = mx
    xx[0] = 1.5 * x[0] - 0.5 * x[1]
    xx[-1] = 1.5 * x[-1] - 0.5 * x[-2]
    xx = np.array(xx) * peak['dt'] + peak['time']
    y = peak['data'][:peak['length']]
    yy = np.zeros(2 * len(x))
    yy[0::2] = y
    yy[1::2] = y
    yy = np.array(yy) / dt_a
    # baseline since we'll fill underneath
    xx = np.concatenate([[xx[0]], xx, [xx[-1]]])
    yy = np.concatenate([[0], yy, [0]])
    return xx, yy