<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def quad_gauss_patterson(order, dist):
 """ Generate sets abscissas and weights for Gauss-Patterson quadrature. Args: order (int) : The quadrature order. Must be in the interval (0, 8). dist (Dist) : The domain to create quadrature over. Returns: (numpy.ndarray, numpy.ndarray) : Abscissas and weights. Example: [[0.0031 0.0198 0.0558 0.1127 0.1894 0.2829 0.3883 0.5 0.6117 0.7171 0.8106 0.8873 0.9442 0.9802 0.9969]] [0.0085 0.0258 0.0465 0.0672 0.0858 0.1003 0.1096 0.1128 0.1096 0.1003 0.0858 0.0672 0.0465 0.0258 0.0085] Reference: Prem Kythe, Michael Schaeferkotter, Handbook of Computational Methods for Integration, Chapman and Hall, 2004, ISBN: 1-58488-428-2, LC: QA299.3.K98. Thomas Patterson, The Optimal Addition of Points to Quadrature Formulae, Mathematics of Computation, Volume 22, Number 104, October 1968, pages 847-856. """

    if len(dist) > 1:

        if isinstance(order, int):
            values = [quad_gauss_patterson(order, d) for d in dist]
        else:
            values = [quad_gauss_patterson(order[i], dist[i])
                      for i in range(len(dist))]

        abscissas = [_[0][0] for _ in values]
        weights = [_[1] for _ in values]
        abscissas = chaospy.quad.combine(abscissas).T
        weights = numpy.prod(chaospy.quad.combine(weights), -1)

        return abscissas, weights

    order = sorted(PATTERSON_VALUES.keys())[order]
    abscissas, weights = PATTERSON_VALUES[order]

    lower, upper = dist.range()

    abscissas = .5*(abscissas*(upper-lower)+upper+lower)
    abscissas = abscissas.reshape(1, abscissas.size)
    weights /= numpy.sum(weights)

    return abscissas, weights