Update custom.py

num_cores parameter is added