That’s exactly what I did. I created a new file workers.py. The data class and run function are in a separate file workers.py which is loaded in the jupyter notebook as import workers.
I did a mistake using multiprocessing pool here. Thanks for notifying me. Now it works smoothly. Cheers.