code: def _get_dx_tree(xy, degree):
      
      x, y = xy
  
      # build smaller tree
      one = numpy.array([numpy.ones(x.shape, dtype=int)])
      tree = [one]
      for d in range(1, degree):
          tree.append(
              numpy.concatenate(
                  [
                      # Integer division `//` would be nice here, but
                      # <https://github.com/sympy/sympy/issues/14542>.
                      [tree[-1][0] / d * (d + 1) * x],
                      tree[-1] * y,
                  ]
              )
          )
  
      # append zeros
      zero = numpy.array([numpy.zeros(x.shape, dtype=int)])
      tree = [zero] + [numpy.concatenate([t, zero]) for t in tree]
      return tree
docs: 0
                              1*(0, 0)  0
                    2*(1, 0)  1*(0, 1)  0
          3*(2, 0)  2*(1, 1)  1*(0, 2)  0
            ...       ...      ...     ...