Deus Ex Machina:[from the latin "god out of the machine."] An entity who appeared in classical plays to resolve the conflict. In film, any character or event brought in arbitrarily to solve the problem, or a solution reached illogically; e.g., the cavalry arrives unexpectedly in the nick of time.
---The Elements of Screenwriting [Irwin R. Blacker]; pg 4
Devi, in her own right is a Deus Ex Machina. However, in the story she is in, she isn't exactly a happy solution to a problem. [they never said a Deus Ex Machina had to be a positive addition to the script ;D]
A character in a story is just about to go off and fight the source of all evil. [<- conflict.] Devi loses control and ghosts said character. [<- solution.]