def _filter_peak_list(peak_list, max_x_index=255, max_y_index=255):
    """Remove false positive peaks at the outer edges.

    Parameters
    ----------
    peak_list : 2D NumPy or 2D list
        [[x0, y0], [x1, y1], ...]
    max_x_index, max_y_index : int, optional
        Default 255.

    Returns
    -------
    peak_list_filtered : 2D NumPy array or 2D list

    Examples
    --------
    >>> import pixstem.cluster_tools as ct
    >>> peak_list = [[128, 129], [10, 52], [0, 120], [255, 123], [123, 255]]
    >>> ct._filter_peak_list(peak_list)
    [[128, 129], [10, 52]]

    See Also
    --------
    _filter_peak_array_radius
    _filter_4D_peak_array
    _filter_peak_list_radius

    """
    peak_list_filtered = []
    for x, y in peak_list:
        if x == 0:
            pass
        elif y == 0:
            pass
        elif x == max_x_index:
            pass
        elif y == max_y_index:
            pass
        else:
            peak_list_filtered.append([x, y])
    return peak_list_filtered
