import itertools


def complete_inds(n, d):
    """
    Return all combinations of powers in an n dimensional d degree
    complete polynomial. This will include a term for all 0th order
    variables (i.e. a constant)

    Parameters
    ----------
    n : int
        The number of parameters in the polynomial

    d : int
        The degree of the complete polynomials

    Returns
    -------
    inds : filter
        A python filter object that contains all the indices inside a
        generator

    """
    i = itertools.product(*[range(d + 1) for i in range(n)])
    return filter(lambda x: sum(x) <= d, i)