(f, u, K)
Returns square-free part of a polynomial in ``K[X]``.

    Examples
    ========

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

    >>> R.dmp_sqf_part(x**3 + 2*x**2*y + x*y**2)
    x**2 + x*y
Returns square-free part of a polynomial in ``K[X]``.
Returns square - free part of a polynomial in K [ X ] .
def dmp_sqf_part(f, u, K):
    """
    Returns square-free part of a polynomial in ``K[X]``.

    Examples
    ========

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

    >>> R.dmp_sqf_part(x**3 + 2*x**2*y + x*y**2)
    x**2 + x*y

    """
    if not u:
        return dup_sqf_part(f, K)

    if K.is_FiniteField:
        return dmp_gf_sqf_part(f, u, K)

    if dmp_zero_p(f, u):
        return f

    if K.is_negative(dmp_ground_LC(f, u, K)):
        f = dmp_neg(f, u, K)

    gcd = dmp_gcd(f, dmp_diff(f, 1, u, K), u, K)
    sqf = dmp_quo(f, gcd, u, K)

    if K.has_Field:
        return dmp_ground_monic(sqf, u, K)
    else:
        return dmp_ground_primitive(sqf, u, K)[1]
def dmp_sqf_part ( f , u , K ) : if not u : return dup_sqf_part ( f , K ) if K . is_FiniteField : return dmp_gf_sqf_part ( f , u , K ) if dmp_zero_p ( f , u ) : return f if K . is_negative ( dmp_ground_LC ( f , u , K ) ) : f = dmp_neg ( f , u , K ) gcd = dmp_gcd ( f , dmp_diff ( f , 1 , u , K ) , u , K ) sqf = dmp_quo ( f , gcd , u , K ) if K . has_Field : return dmp_ground_monic ( sqf , u , K ) else : return dmp_ground_primitive ( sqf , u , K ) [ 1 ]