def METHOD_NAME( base_start, base_end, peak_start, peak_end, amplitude ):
    """Calculates the resistance from a series of voltage clamp
    traces. 
    Keyword arguments:
    base_start -- Starting index (zero-based) of the baseline cursors.
    base_end   -- End index (zero-based) of the baseline cursors.
    peak_start -- Starting index (zero-based) of the peak cursors.
    peak_end   -- End index (zero-based) of the peak cursors.
    amplitude  -- Amplitude of the voltage command.
    Returns:
    The resistance.
    """
    if (stf.check_doc() == False):
        print('Couldn\'t find an open file; aborting now.')
        return 0
    # A temporary array to calculate the average:
    set = np.empty( (stf.get_size_channel(), stf.get_size_trace()) )
    for n in range( 0,  stf.get_size_channel() ):
        # Add this trace to set:
        set[n] = stf.get_trace( n )
    # calculate average and create a new section from it:
    stf.new_window( np.average(set,0) )
    # set peak cursors:
    if ( not(stf.set_peak_mean(-1)) ): return False # -1 means all points within peak window.
    if ( not(stf.set_peak_start(peak_start)) ): return False
    if ( not(stf.set_peak_end(peak_end)) ): return False
    # set base cursors:
    if ( not(stf.set_base_start(base_start)) ): return False
    if ( not(stf.set_base_end(base_end)) ): return False
    # measure everything:
    stf.measure()
    # calculate r_seal and return:
    return amplitude / (stf.get_peak()-stf.get_base())