If you haven't already, install pipenv:
pip install pipenv
Install dependencies:
pipenv install
Assume that this code has been in production for years without complaint. We are trying to understand the code better so are going to use our refactoring skills to "read" the code.
Add tests as needed. Be careful to maintain existing functionality as you refactor.
Sniff out the smells and refactor them away!