Python Function Modify Input Process Output Model