whitelist.py: Move whitelist_networks variable into appropriate function.