20407577511da192b6a08f103269dea0efbd8daf,maths/PrimeCheck.py,,primeCheck,#Any#,1

Before Change

def primeCheck(number):
    prime = True
    for i in range(2, int(number**(0.5)+1), 2):
        if i != 2:
            i = i - 1
        if number % i == 0:
            prime = False
            break
    return prime

def main():
    print(primeCheck(37))

After Change


def primeCheck(number):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))

def main():
    print(primeCheck(37))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: TheAlgorithms/Python
Commit Name: 20407577511da192b6a08f103269dea0efbd8daf
Time: 2018-10-28
Author: dheerajreddymumma@gmail.com
File Name: maths/PrimeCheck.py
Class Name:
Method Name: primeCheck


Project Name: keras-team/autokeras
Commit Name: c99295e1903952b3b806c4fd641e28f852b17c36
Time: 2018-04-18
Author: jhfjhfj1@gmail.com
File Name: autokeras/utils.py
Class Name: ModelTrainer
Method Name: train_model