<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ends_of_next_whole_turn(self, root):
 """Simulate one complete turn to completion and generate each end of turn reached during the simulation. Note on mana drain: Generates but does not continue simulation of mana drains. Arguments: root: a start state with no parent """

        # simple confirmation that the root is actually a root.
        # otherwise it may seem to work but would be totally out of spec
        if root.parent:
            raise ValueError('Unexpectedly received a node with a parent for'
                             ' root:\n{}'.format(root))
        # build the list of eots (or just the root if first turn) to be run
        leaves = list(root.leaves())
        kw_starts = list()
        if leaves[0] is root:
            # build ends of state kwargs as only the root
            kw_starts.append({'root': root})
        else:
            # build ends of state kwargs as eots in the tree
            for leaf in leaves:
                # ignore mana drains
                if not leaf.is_mana_drain:
                    kw_starts.append({'root_eot': leaf})
        # run a single turn for each starting point
        for kw_start in kw_starts:
            for eot in self.ends_of_one_state(**kw_start):
                yield eot