code: def inner(*args):
      
      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)
docs: 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:
          >>> x,y = cp.variable(2)
          >>> P = cp.Poly([x-1, y])
          >>> Q = cp.Poly([x+1, x*y])
          >>> print(cp.inner(P, Q))
          q0^2+q0q1^2-1
          >>> x = numpy.arange(4)
          >>> print(cp.inner(x, x))
          14