Re Replace Python Function Definitions