Deus ex machina (Latin: [ˈdeʊs ɛks ˈmaː.kʰɪ.naː]: /ˈdeɪ.əs ɛks ˈmɑːkiːnə/ or /ˈdiːəs ɛks ˈmækɪnə/; plural: dei ex machina) is a Latin calque from Greek ἀπὸ μηχανῆς θεός (apò mēkhanês theós), meaning 'god from the machine'. The term has evolved to mean a plot device whereby a seemingly unsolvable problem is suddenly and abruptly resolved by the inspired and unexpected intervention of some new event, character, ability or object. Its function can be to resolve an otherwise irresolvable plot situation, to surprise the audience, to bring the tale to a happy ending, or act as a comedic device.