Fix flake8 errors 

use "not in" instead of "not key in dict"