'Returns the coefficient that stands next to the given monomial.
Parameters
element : PolyElement (with ``is_monomial = True``) or 1
Examples
>>> from sympy.polys.rings import ring
>>> from sympy.polys.domains import ZZ
>>> _, x, y, z = ring("x,y,z", ZZ)
>>> f = 3*x**2*y - x*y*z + 7*z**3 + 23
>>> f.coeff(x**2*y)
3
>>> f.coeff(x*y)
0
>>> f.coeff(1)
23'

def coeff(self, element):

    if (element == 1):
        return self._get_coeff(self.ring.zero_monom)
    elif isinstance(element, self.ring.dtype):
        terms = list(element.iterterms())
        if (len(terms) == 1):
            (monom, coeff) = terms[0]
            if (coeff == self.ring.domain.one):
                return self._get_coeff(monom)
    raise ValueError(('expected    a    monomial,    got    %s' % element))
