Add some type annotations to help PyCharm (in particular) to figure out the types of a bunch of things.