<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def orth_chol(order, dist, normed=True, sort="GR", cross_truncation=1., **kws):
 """ Create orthogonal polynomial expansion from Cholesky decomposition. Args: order (int):
 Order of polynomial expansion dist (Dist):
 Distribution space where polynomials are orthogonal normed (bool):
 If True orthonormal polynomials will be used instead of monic. sort (str):
 Ordering argument passed to poly.basis. If custom basis is used, argument is ignored. cross_truncation (float):
 Use hyperbolic cross truncation scheme to reduce the number of terms in expansion. Examples: [1.0, q0, 0.7071q0^2-0.7071, 0.4082q0^3-1.2247q0] """

    dim = len(dist)
    basis = chaospy.poly.basis(
        start=1, stop=order, dim=dim, sort=sort,
        cross_truncation=cross_truncation,
    )
    length = len(basis)

    cholmat = chaospy.chol.gill_king(chaospy.descriptives.Cov(basis, dist))
    cholmat_inv = numpy.linalg.inv(cholmat.T).T
    if not normed:
        diag_mesh = numpy.repeat(numpy.diag(cholmat_inv), len(cholmat_inv))
        cholmat_inv /= diag_mesh.reshape(cholmat_inv.shape)

    coefs = numpy.empty((length+1, length+1))

    coefs[1:, 1:] = cholmat_inv
    coefs[0, 0] = 1
    coefs[0, 1:] = 0

    expected = -numpy.sum(
        cholmat_inv*chaospy.descriptives.E(basis, dist, **kws), -1)
    coefs[1:, 0] = expected

    coefs = coefs.T

    out = {}
    out[(0,)*dim] = coefs[0]
    for idx in range(length):
        index = basis[idx].keys[0]
        out[index] = coefs[idx+1]

    polynomials = chaospy.poly.Poly(out, dim, coefs.shape[1:], float)

    return polynomials