code: def create_weights(nodes, dist):
      
      poly = chaospy.quad.generate_stieltjes(dist, len(nodes)-1, retall=True)[0]
      poly = chaospy.poly.flatten(chaospy.poly.Poly(poly))
      weights_inverse = poly(nodes)
      weights = numpy.linalg.inv(weights_inverse)
      return weights[:, 0]
docs: Create weights for the Laja method.