from enum import Enum class Questions(Enum): TIME = "time" REPO = "repo" NONE = "none" def taktyka_dialogu(frame): return questions(frame) # TODO inna taktyka def questions(frame): for slot in frame['slots']: if slot[0] == "time_when" and slot[1] == None: return Questions.TIME if slot[0] == "repo" and (slot[1] == None or slot[1] == ""): return Questions.REPO return Questions.NONE