def evaluate_cumulant(cum, positive_times=[], leading_index=None, lang='Python', arrays=None):
    '\n    \n    '
    t0 = time.time()
    A = cum.rewrite(gg)
    expr = CumulantExpr(A)
    expr = expr.evaluate()
    t1 = time.time()
    for tt in positive_times:
        expr = CumulantExpr(expr)._make_positive(tt)
    t2 = time.time()
    if (leading_index is not None):
        D = expr._leading_index(leading_index)
        expr = D._getExpr()
    t3 = time.time()
    if (lang == 'Fortran'):
        ss = fortran_code(expr.__str__())
    elif (lang == 'Python'):
        ss = python_code(expr.__str__(), arrays=arrays)
    else:
        raise Exception('Unknown language')
    print((t1 - t0))
    print((t2 - t1))
    print((t3 - t2))
    return ss
def evaluate_cumulant(cum, positive_times=[], leading_index=None, lang='Python', arrays=None):
    '\n    \n    '
    t0 = time.time()
    A = cum.rewrite(gg)
    expr = CumulantExpr(A)
    expr = expr.evaluate()
    t1 = time.time()
    for tt in positive_times:
        expr = CumulantExpr(expr)._make_positive(tt)
    t2 = time.time()
    if (leading_index is not None):
        D = expr._leading_index(leading_index)
        expr = D._getExpr()
    t3 = time.time()
    if (lang == 'Fortran'):
        ss = fortran_code(expr.__str__())
    elif (lang == 'Python'):
        ss = python_code(expr.__str__(), arrays=arrays)
    else:
        raise Exception('Unknown language')
    print((t1 - t0))
    print((t2 - t1))
    print((t3 - t2))
    return ss