def dmp_clear_denoms(f, u, K0, K1=None, convert=False):
 if (not u):
  return dup_clear_denoms(f, K0, K1, convert=convert)
 if (K1 is None):
  if K0.has_assoc_Ring:
   K1 = K0.get_ring()
  else:
   K1 = K0
 common = _rec_clear_denoms(f, u, K0, K1)
 if (not K1.is_one(common)):
  f = dmp_mul_ground(f, common, u, K0)
 if (not convert):
  return (common, f)
 else:
  return (common, dmp_convert(f, u, K0, K1))

def dmp_clear_denoms ( f , u , K0 , K1 = None , convert = False ) : if ( not u ) : return dup_clear_denoms ( f , K0 , K1 , convert = convert ) if ( K1 is None ) : if K0 . has_assoc_Ring : K1 = K0 . get_ring ( ) else : K1 = K0 common = _rec_clear_denoms ( f , u , K0 , K1 ) if ( not K1 . is_one ( common ) ) : f = dmp_mul_ground ( f , common , u , K0 ) if ( not convert ) : return ( common , f ) else : return ( common , dmp_convert ( f , u , K0 , K1 ) )
clear denominators .