def __frequency_butterworth_filter(shape, cutoff, order):
    r"""
    Builds an N-D butterworth filter

        ..math::

            f = \frac{1.0}{1.0 + (w / cutoff)^{2n}}

    The frequency origin of the returned filter is at the corners.

    Parameters
    ----------
    shape : tuple
        The size of the filter (M, N, ...)
    cutoff : double
        Cutoff frequency of the filter in the range `[0, 0.5]`
    order : positive int
        Order of the filter. The higher it is the sharper the transition

    Returns
    -------
    butterworth_filter : (M, N, ...) ndarray
        The butterworth filter for the given parameters. Will be the same
        shape as was requested.
    """
    # Dimension-free sum of squares
    grid = __adjusted_meshgrid(shape)
    grid_sq = [g ** 2 for g in grid]
    grid_sq = sum(grid_sq)

    radius = np.sqrt(grid_sq)
    return np.fft.ifftshift(((radius / cutoff) ** (2 * order) + 1.0) / 1.0)


# TODO: merge the 2D and 3D versions if possible
dataset/ETHPy150Open menpo/menpo/menpo/math/convolution.py/__frequency_butterworth_filter/swapped operands of `/`