inventory: Remove pyflakes and unused code