def _faa_di_bruno_partitions(n):
    """ Return all non-negative integer solutions of the diophantine equation::

            n*k_n + ... + 2*k_2 + 1*k_1 = n   (1)

    Parameters
    ----------
    n: int
        the r.h.s. of Eq. (1)

    Returns
    -------
    partitions: a list of solutions of (1). Each solution is itself
        a list of the form `[(m, k_m), ...]` for non-zero `k_m`.
        Notice that the index `m` is 1-based.

    Examples:
    ---------
    >>> _faa_di_bruno_partitions(2)
    [[(1, 2)], [(2, 1)]]
    >>> for p in faa_di_bruno_partitions(4):
    ...     assert 4 == sum(m * k for (m, k) in p)

    """
    if n < 1:
        raise ValueError("Expected a positive integer; got %s instead" % n)
    try:
        return _faa_di_bruno_cache[n]
    except __HOLE__:
        # TODO: higher order terms
        # solve Eq. (31) from Blinninkov & Moessner here
        raise NotImplementedError('Higher order terms not yet implemented.')
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/distributions/edgeworth.py/_faa_di_bruno_partitions