(f, K)
return g, f[::g]
Map ``x**m`` to ``y`` in a polynomial in ``K[x]``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dup_deflate

    >>> f = ZZ.map([1, 0, 0, 1, 0, 0, 1])

    >>> dup_deflate(f, ZZ)
    (3, [1, 1, 1])
Map ``x**m`` to ``y`` in a polynomial in ``K[x]``.
Map x ** m to y in a polynomial in K [ x ] .
def dup_deflate(f, K):
    """
    Map ``x**m`` to ``y`` in a polynomial in ``K[x]``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dup_deflate

    >>> f = ZZ.map([1, 0, 0, 1, 0, 0, 1])

    >>> dup_deflate(f, ZZ)
    (3, [1, 1, 1])

    """
    if dup_degree(f) <= 0:
        return 1, f

    g = 0

    for i in xrange(len(f)):
        if not f[-i - 1]:
            continue

        g = igcd(g, i)

        if g == 1:
            return 1, f

    return g, f[::g]
def dup_deflate ( f , K ) : if dup_degree ( f ) <= 0 : return 1 , f g = 0 for i in xrange ( len ( f ) ) : if not f [ - i - 1 ] : continue g = igcd ( g , i ) if g == 1 : return 1 , f return g , f [ : : g ]