(p1)
return p
Compute ``x**n * p1(1/x)`` for ``p1`` univariate polynomial.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import _invert_monoms
    >>> R, x = ring('x', ZZ)
    >>> p = x**2 + 2*x + 3
    >>> _invert_monoms(p)
    3*x**2 + 2*x + 1

    See Also
    ========
    sympy.polys.densebasic.dup_reverse
Compute ``x**n * p1(1/x)`` for ``p1`` univariate polynomial.
Compute x ** n * p1 ( 1 / x ) for p1 univariate polynomial .
def _invert_monoms(p1):
    """
    Compute ``x**n * p1(1/x)`` for ``p1`` univariate polynomial.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import _invert_monoms
    >>> R, x = ring('x', ZZ)
    >>> p = x**2 + 2*x + 3
    >>> _invert_monoms(p)
    3*x**2 + 2*x + 1

    See Also
    ========
    sympy.polys.densebasic.dup_reverse

    """
    terms = list(p1.items())
    terms.sort()
    deg = p1.degree()
    ring = p1.ring
    p = ring.zero
    cv = p1.listcoeffs()
    mv = p1.listmonoms()
    for i in range(len(mv)):
        p[(deg - mv[i][0],)] = cv[i]
    return p
def _invert_monoms ( p1 ) : terms = list ( p1 . items ( ) ) terms . sort ( ) deg = p1 . degree ( ) ring = p1 . ring p = ring . zero cv = p1 . listcoeffs ( ) mv = p1 . listmonoms ( ) for i in range ( len ( mv ) ) : p [ ( deg - mv [ i ] [ 0 ] , ) ] = cv [ i ] return p