Add type annotations, and fix issues found by mypy
The issues weren't noticed before because mypy does not analyze functions without an annotation in their signature.
Migrated from D7148 (view on Phabricator)
Staging instance, all changes can be removed at any time
The issues weren't noticed before because mypy does not analyze functions without an annotation in their signature.
Migrated from D7148 (view on Phabricator)