def dup_sqf_part(f, K):
 if K.is_FiniteField:
  return dup_gf_sqf_part(f, K)
 if (not f):
  return f
 if K.is_negative(dup_LC(f, K)):
  f = dup_neg(f, K)
 gcd = dup_gcd(f, dup_diff(f, 1, K), K)
 sqf = dup_quo(f, gcd, K)
 if K.has_Field:
  return dup_monic(sqf, K)
 else:
  return dup_primitive(sqf, K)[1]

def dup_sqf_part ( f , K ) : if K . is_FiniteField : return dup_gf_sqf_part ( f , K ) if ( not f ) : return f if K . is_negative ( dup_LC ( f , K ) ) : f = dup_neg ( f , K ) gcd = dup_gcd ( f , dup_diff ( f , 1 , K ) , K ) sqf = dup_quo ( f , gcd , K ) if K . has_Field : return dup_monic ( sqf , K ) else : return dup_primitive ( sqf , K ) [ 1 ]
returns square-free part of a polynomial in k[x] .