class_docstr: A true polynomial ring, with objects DMP. 
class_docstr_tok: ["A","true","polynomial","ring",",","with","objects","DMP","."]
docstr: Convert SymPy's expression to ``dtype``. 
docstr_tok: ["Convert","SymPy","'s","expression","to","``","dtype","``","."]
code: def from_sympy(self, a):
      """Convert SymPy's expression to ``dtype``."""
      try:
          rep, _ = dict_from_basic(a, gens=self.gens)
      except PolynomialError:
          raise CoercionFailed(
              "Cannot convert %s to type %s" % (a, self)
          )
  
      for k, v in rep.items():
          rep[k] = self.dom.from_sympy(v)
  
      return DMP.from_dict(rep, self.ngens - 1, self.dom)
  
imports: from sympy.polys.agca.modules import FreeModulePolyRing
  from sympy.polys.domains.compositedomain import CompositeDomain
  from sympy.polys.domains.old_fractionfield import FractionField
  from sympy.polys.domains.ring import Ring
  from sympy.polys.orderings import monomial_key, build_product_order
  from sympy.polys.polyclasses import DMP, DMF
  from sympy.polys.polyerrors import GeneratorsNeeded, PolynomialError, CoercionFailed, ExactQuotientFailed, NotReversible
  from sympy.polys.polyutils import dict_from_basic, basic_from_dict, _dict_reorder
  from sympy.utilities import public
  from sympy.utilities.iterables import iterable
label_desc: Use image node_id 4 for calling the GlobalPolynomialRing obj's underlying member method code with example usage: obj.from_sympy(a) and returns: DMP