Lint fixes for key.py and utils/network.py