code: def dot(poly1, poly2):
      
      if not isinstance(poly1, Poly) and not isinstance(poly2, Poly):
          return numpy.dot(poly1, poly2)
  
      poly1 = Poly(poly1)
      poly2 = Poly(poly2)
  
      poly = poly1*poly2
      if numpy.prod(poly1.shape) <= 1 or numpy.prod(poly2.shape) <= 1:
          return poly
      return chaospy.poly.sum(poly, 0)
docs: Dot product of polynomial vectors.
  
      Args:
          poly1 (Poly) : left part of product.
          poly2 (Poly) : right part of product.
  
      Returns:
          (Poly) : product of poly1 and poly2.
  
      Examples:
          >>> poly = cp.prange(3, 1)
          >>> print(poly)
          [1, q0, q0^2]
          >>> print(cp.dot(poly, numpy.arange(3)))
          2q0^2+q0
          >>> print(cp.dot(poly, poly))
          q0^4+q0^2+1