def METHOD_NAME(waveform, start_index=0, end_index=500, order=1):
    """
    Finds baseline from start index to end index samples (default linear)
    """
    if end_index == -1:
        end_index = len(waveform)
    x = np.arange(start_index, end_index)
    wf = waveform[start_index:end_index]
    p = np.polyfit(x, wf, order)
    return p