dths that mark the pad area on both sides in the given
    dimension.
length_pair : 2-element sequence of None or int
    Gives the number of values in valid area from each side that is
    taken into account when calculating the statistic. If None the entire
    valid area in `padded` is considered.
stat_func : function
    Function to compute statistic. The expected signature is
    ``stat_func(x: ndarray, axis: int, keepdims: bool) -> ndarray``.

Returns
-------
left_stat, right_stat : ndarray
    Calculated statistic for both sides of `padded`.
r