PEP8 cleanup of network.py