def isPrime(N, false_positive_prob=1e-06, randfunc=None):
 if (randfunc is None):
  _import_Random()
  randfunc = Random.new().read
 if (_fastmath is not None):
  return _fastmath.isPrime(long(N), false_positive_prob, randfunc)
 if ((N < 3) or ((N & 1) == 0)):
  return (N == 2)
 for p in sieve_base:
  if (N == p):
   return 1
  if ((N % p) == 0):
   return 0
 rounds = int(math.ceil(((- math.log(false_positive_prob)) / math.log(4))))
 return _rabinMillerTest(N, rounds, randfunc)

def isPrime ( N , false_positive_prob = 1e-06 , randfunc = None ) : if ( randfunc is None ) : _import_Random ( ) randfunc = Random . new ( ) . read if ( _fastmath is not None ) : return _fastmath . isPrime ( long ( N ) , false_positive_prob , randfunc ) if ( ( N < 3 ) or ( ( N & 1 ) == 0 ) ) : return ( N == 2 ) for p in sieve_base : if ( N == p ) : return 1 if ( ( N % p ) == 0 ) : return 0 rounds = int ( math . ceil ( ( ( - math . log ( false_positive_prob ) ) / math . log ( 4 ) ) ) ) return _rabinMillerTest ( N , rounds , randfunc )
isprime:bool return true if n is prime .