def METHOD_NAME(waveform_extractor, peak_sign: str = "neg"):
    """
    In some situations spike sorters could return a spike index with a small shift related to the waveform peak.
    This function estimates and return these alignment shifts for the mean template.
    This function is internally used by `compute_spike_amplitudes()` to accurately retrieve the spike amplitudes.
    Parameters
    ----------
    waveform_extractor: WaveformExtractor
        The waveform extractor
    peak_sign: str
        Sign of the template to compute best channels ('neg', 'pos', 'both')
    Returns
    -------
    shifts: dict
        Dictionary with unit ids as keys and shifts as values
    """
    sorting = waveform_extractor.sorting
    unit_ids = sorting.unit_ids
    extremum_channels_ids = get_template_extremum_channel(waveform_extractor, peak_sign=peak_sign)
    shifts = {}
    templates = waveform_extractor.get_all_templates(mode="average")
    for unit_ind, unit_id in enumerate(unit_ids):
        template = templates[unit_ind, :, :]
        chan_id = extremum_channels_ids[unit_id]
        chan_ind = waveform_extractor.channel_ids_to_indices([chan_id])[0]
        if peak_sign == "both":
            peak_pos = np.argmax(np.abs(template[:, chan_ind]))
        elif peak_sign == "neg":
            peak_pos = np.argmin(template[:, chan_ind])
        elif peak_sign == "pos":
            peak_pos = np.argmax(template[:, chan_ind])
        shift = peak_pos - waveform_extractor.nbefore
        shifts[unit_id] = shift
    return shifts