Python Check If Array Of Substrings In Sql