def is_square(n, prep=True):
 if prep:
  n = as_int(n)
  if (n < 0):
   return False
  if (n in [0, 1]):
   return True
 m = (n & 127)
 if (not (((m * 2344881533) & (m * 2716005841)) & 1311242)):
  m = (n % 63)
  if (not (((m * 1028201975) & (m * 3357846009)) & 284246024)):
   from sympy.ntheory import perfect_power
   if perfect_power(n, [2]):
    return True
 return False

def is_square ( n , prep = True ) : if prep : n = as_int ( n ) if ( n < 0 ) : return False if ( n in [ 0 , 1 ] ) : return True m = ( n & 127 ) if ( not ( ( ( m * 2344881533 ) & ( m * 2716005841 ) ) & 1311242 ) ) : m = ( n % 63 ) if ( not ( ( ( m * 1028201975 ) & ( m * 3357846009 ) ) & 284246024 ) ) : from sympy . ntheory import perfect_power if perfect_power ( n , [ 2 ] ) : return True return False
return true if n == a * a for some integer a .