https://alexandra-zaharia.github.io/posts/function-timeout-in-python-signal/
Function timeout in Python using the signal module - Alexandra Zaharia