python check if string is valid integer