Update module.py

Created a self-diagnostic function.