<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inner(*args):
 """ Inner product of a polynomial set. Args: args (chaospy.poly.base.Poly):
 The polynomials to perform inner product on. Returns: (chaospy.poly.base.Poly):
 Resulting polynomial. Examples: q0^2+q0q1^2-1 14 """

    haspoly = sum([isinstance(arg, Poly) for arg in args])

    # Numpy
    if not haspoly:
        return numpy.sum(numpy.prod(args, 0), 0)

    # Poly
    out = args[0]
    for arg in args[1:]:
        out = out * arg
    return sum(out)