Sample runtimeerror when cores>1

I am also getting this error. Unfortunately, I cannot always put my code within an if __name__ == '__main__'.