Re Replace Python Function Definition