def METHOD_NAME(self, session, text='', part_of_speech=0):
    text = text.strip()
    words = []
    if text:
        with Session() as session:
            old_words = set(s for (s,) in session.query(PromoCodeWord.normalized_word).filter(
                PromoCodeWord.part_of_speech == part_of_speech).all())
        for word in [s for s in shlex.split(text.replace(',', ' ')) if s]:
            if PromoCodeWord.normalize_word(word) not in old_words:
                words.append(PromoCodeWord().apply(
                    dict(word=word, part_of_speech=part_of_speech)))
        words = [word.word for word in session.bulk_insert(words)]
    return {'words': words}