Python Function Modify Input Devices