def rs_is_puiseux(p, x):
 index = p.ring.gens.index(x)
 for k in p:
  if (k[index] != int(k[index])):
   return True
  if (k[index] < 0):
   raise ValueError(('The series is not regular in %s' % x))
 return False

def rs_is_puiseux ( p , x ) : index = p . ring . gens . index ( x ) for k in p : if ( k [ index ] != int ( k [ index ] ) ) : return True if ( k [ index ] < 0 ) : raise ValueError ( ( 'The series is not regular in %s' % x ) ) return False
test if p is puiseux series in x .