(f, n, u, K)
return g
Raise ``f`` to the ``n``-th power in ``K[X]``.

    Examples
    ========

    >>> from sympy.polys import ring, ZZ
    >>> R, x,y = ring("x,y", ZZ)

    >>> R.dmp_pow(x*y + 1, 3)
    x**3*y**3 + 3*x**2*y**2 + 3*x*y + 1
Raise ``f`` to the ``n``-th power in ``K[X]``.
Raise f to the n - th power in K [ X ] .
def dmp_pow(f, n, u, K):
    """
    Raise ``f`` to the ``n``-th power in ``K[X]``.

    Examples
    ========

    >>> from sympy.polys import ring, ZZ
    >>> R, x,y = ring("x,y", ZZ)

    >>> R.dmp_pow(x*y + 1, 3)
    x**3*y**3 + 3*x**2*y**2 + 3*x*y + 1

    """
    if not u:
        return dup_pow(f, n, K)

    if not n:
        return dmp_one(u, K)
    if n < 0:
        raise ValueError("can't raise polynomial to a negative power")
    if n == 1 or dmp_zero_p(f, u) or dmp_one_p(f, u, K):
        return f

    g = dmp_one(u, K)

    while True:
        n, m = n//2, n

        if m & 1:
            g = dmp_mul(g, f, u, K)

            if not n:
                break

        f = dmp_sqr(f, u, K)

    return g
def dmp_pow ( f , n , u , K ) : if not u : return dup_pow ( f , n , K ) if not n : return dmp_one ( u , K ) if n < 0 : raise ValueError ( "can't raise polynomial to a negative power" ) if n == 1 or dmp_zero_p ( f , u ) or dmp_one_p ( f , u , K ) : return f g = dmp_one ( u , K ) while True : n , m = n // 2 , n if m & 1 : g = dmp_mul ( g , f , u , K ) if not n : break f = dmp_sqr ( f , u , K ) return g