Change indentation of closing }, ], ) and combinations of them
Workaround deadlock in ipython

shutdown_hook is called after all non-daemon threads exit, but it is needed for 
them to exit. Thus I had to use daemon threads in ipython or find some hack to 
make .shutdown be called earlier.