python check if list is not none or empty