class_docstr: Efficient representation of ``coeff*(numer/denom)``. 
class_docstr_tok: ["Efficient","representation","of","``","coeff","*","(","numer\/denom",")","``","."]
code: def __init__(self, term, numer=None, denom=None):  # Term
      if numer is None and denom is None:
          if not term.is_commutative:
              raise NonCommutativeExpression(
                  "commutative expression expected"
              )
  
          coeff, factors = term.as_coeff_mul()
          numer, denom = defaultdict(int), defaultdict(int)
  
          for factor in factors:
              base, exp = decompose_power(factor)
  
              if base.is_Add:
                  cont, base = base.primitive()
                  coeff *= cont**exp
  
              if exp > 0:
                  numer[base] += exp
              else:
                  denom[base] += -exp
  
          numer = Factors(numer)
          denom = Factors(denom)
      else:
          coeff = term
  
          if numer is None:
              numer = Factors()
  
          if denom is None:
              denom = Factors()
  
      self.coeff = coeff
      self.numer = numer
      self.denom = denom
  
imports: from .add import Add
  from .mul import Mul, _keep_coeff
  from .power import Pow
  from .basic import Basic
  from .expr import Expr
  from .function import expand_power_exp
  from .sympify import sympify
  from .numbers import Rational, Integer, Number, I, equal_valued
  from .singleton import S
  from .sorting import default_sort_key, ordered
  from .symbol import Dummy
  from .traversal import preorder_traversal
  from .coreerrors import NonCommutativeExpression
  from .containers import Tuple, Dict
  from sympy.external.gmpy import SYMPY_INTS
  from sympy.utilities.iterables import common_prefix, common_suffix, variations, iterable, is_sequence
  from collections import defaultdict
  from typing import Tuple
label_desc: Use image node_id 1 to create a new Term object  with example: obj = Term(term, numer, denom)