code: def quad_gauss_legendre(order, lower=0, upper=1, composite=None):
      
      order = numpy.asarray(order, dtype=int).flatten()
      lower = numpy.asarray(lower).flatten()
      upper = numpy.asarray(upper).flatten()
  
      dim = max(lower.size, upper.size, order.size)
      order = numpy.ones(dim, dtype=int)*order
      lower = numpy.ones(dim)*lower
      upper = numpy.ones(dim)*upper
  
      if composite is None:
          composite = numpy.array(0)
      composite = numpy.asarray(composite)
  
      if not composite.size:
          composite = numpy.array([numpy.linspace(0, 1, composite+1)]*dim)
  
      else:
          composite = numpy.array(composite)
          if len(composite.shape) <= 1:
              composite = numpy.transpose([composite])
          composite = ((composite.T-lower)/(upper-lower)).T
  
      results = [_gauss_legendre(order[i], composite[i]) for i in range(dim)]
      abscis = numpy.array([_[0] for _ in results])
      weights = numpy.array([_[1] for _ in results])
  
      abscis = chaospy.quad.combine(abscis)
      weights = chaospy.quad.combine(weights)
  
      abscis = (upper-lower)*abscis + lower
      weights = numpy.prod(weights*(upper-lower), 1)
  
      return abscis.T, weights
docs: Generate the quadrature nodes and weights in Gauss-Legendre quadrature.
  
      Example:
          >>> abscissas, weights = quad_gauss_legendre(3)
          >>> print(numpy.around(abscissas, 4))
          [[0.0694 0.33   0.67   0.9306]]
          >>> print(numpy.around(weights, 4))
          [0.1739 0.3261 0.3261 0.1739]