The example code of progress_dialog.py is not working.
Actually, I think the issue is with the progress dialog itself:
lib/python3.10/site-packages/prompt_toolkit/shortcuts/dialogs.py", line 267, in progress_dialog
loop = get_running_loop()
RuntimeError: no running event loop