class_docstr: A simple implementation
  of a polynomial class that
  records the details about two polynomials
  that are potentially comprised of multiple
  variables.
class_docstr_tok: ["A","simple","implementation","of","a","polynomial","class","that","records","the","details","about","two","polynomials","that","are","potentially","comprised","of","multiple","variables","."]
docstr: Multiply a given polynomial
  to a copy of self.
docstr_tok: ["Multiply","a","given","polynomial","to","a","copy","of","self","."]
code: def __mul__(self, other: Union[int, float, Fraction, Monomial]):
      """
      Multiply a given polynomial
      to a copy of self.
      """
      if (
          isinstance(other, int)
          or isinstance(other, float)
          or isinstance(other, Fraction)
      ):
          result = Polynomial([])
          monos = {m.clone() for m in self.all_monomials()}
          for m in monos:
              result = result.__add__(m.clone() * other)
          return result
      elif isinstance(other, Monomial):
          result = Polynomial([])
          monos = {m.clone() for m in self.all_monomials()}
          for m in monos:
              result = result.__add__(m.clone() * other)
          return result
      elif isinstance(other, Polynomial):
          temp_self = {m.clone() for m in self.all_monomials()}
          temp_other = {m.clone() for m in other.all_monomials()}
  
          result = Polynomial([])
  
          for i in temp_self:
              for j in temp_other:
                  result = result.__add__(i * j)
  
          return result
      else:
          raise ValueError(
              "Can only multiple int, float, Fraction, Monomials, or Polynomials with Polynomials."
          )
  
imports: from fractions import Fraction
  from typing import Dict, Union, Set, Iterable
  from numbers import Rational
  from functools import reduce
label_desc: Use image node_id 5 for calling the Polynomial obj's underlying member method code with example usage: obj.__mul__(other) and returns: result, result, result