lint: replace simple filter() usage with list comprehensions

In this case list comprehensions are probably easier to read especially
for those that forget how filter() operates when passed 'None' as a
function argument.

Also, it keeps the return datatypes the same across py2 vs py3 since
filter() returns lists in py2 and filter objects in py3.
lint: disable unnecessary undefined loop variable warnings

All cases appear to be guaranteed to have defined variables because most
of the loops are iterating over hardcoded items.
lint: remove unused imports