Implement Timeout For A Function In Python