CLN:Unused Variables
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Used PyCharm inspections to check:

- Unused local variables
- Unreachable code
- `set([..])` to `{...}`
I thought flake8 checked for unused variables, unreachable code.  Are we using an old version or something?

The set comprehensions are a good fix.  Might be worth adding that flake8 plugin while you’re at it. I'm not sure if PyCharm is using flake8 under the hood or they have their own introspection method, but it was catching some things that flake8 wasn't.

Nonetheless, I'll scale this back and break it into smaller PR's