As we know, main module in spawned processes is an empty module in fact. So, python multiprocessing fails in notebook on Windows in general, unless the code is like below, that is, not codes between imports and
if __name__== "__main__"
from ZZZ import dosomething
if __name__ == "__main__":
Is there an elegant way to know this situation? Thus, dosomething() can spawn new processes without exception.