Re Replace Python Function Syntax