python check if string is in list of substrings