CLN: clean up data.py

closes #4001.