human
Write me a the Python program you requested given the following:
Solve in Python:
A generalization of Bézier surfaces, called the S-patch, uses an interesting scheme for indexing its control points.

In the case of an n-sided surface of degree d, each index has n non-negative integers that sum to d, and all possible configurations are used.

For example, for a 3-sided quadratic (degree 2) surface the control points are:

> indices 3 2 => [[0,0,2],[0,1,1],[0,2,0],[1,0,1],[1,1,0],[2,0,0]]

Given the degree and the number of sides, generate all control point indices.
The order of the indices in the list can be arbitrary, so for the above example

> [[1,1,0],[2,0,0],[0,0,2],[0,2,0],[0,1,1],[1,0,1]]

is also a good solution.
assistant
#Here is the Python program you requested.

def indices(n, d):
    result=[]
    temp=[]
    def tt (n, d,temp):
        if d==1:
            result.extend([temp+[n]])
            return 0
        for i in range(0,n+1):
            aa=temp+[i]
            tt(n-i, d-1,aa)
    tt(d, n,temp)
    return result