class_docstr: Class representing a monomial, i.e. a product of powers. 
class_docstr_tok: ["Class","representing","a","monomial",",","i.e",".","a","product","of","powers","."]
code: def __init__(self, monom, gens=None):
      if not iterable(monom):
          rep, gens = dict_from_expr(sympify(monom), gens=gens)
          if len(rep) == 1 and list(rep.values())[0] == 1:
              monom = list(rep.keys())[0]
          else:
              raise ValueError(
                  "Expected a monomial got {}".format(monom)
              )
  
      self.exponents = tuple(map(int, monom))
      self.gens = gens
  
imports: from itertools import combinations_with_replacement, product
  from textwrap import dedent
  from sympy.core import Mul, S, Tuple, sympify
  from sympy.polys.polyerrors import ExactQuotientFailed
  from sympy.polys.polyutils import PicklableWithSlots, dict_from_expr
  from sympy.utilities import public
  from sympy.utilities.iterables import is_sequence, iterable
label_desc: Use image node_id 1 to create a new Monomial object from inherited base classes: PicklableWithSlots with example: obj = Monomial(monom, gens)