<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_one_state(self, root=None, root_eot=None):
 """Simulate a complete turn from one state only and generate each end of turn reached in the simulation. Arguments: Exactly one of: root: a start state with no parent or root_eot: an EOT or ManaDrain transition in the simulation """

        # basic confirmation of valid arguments
        self._argument_gauntlet(root_eot, root)
        # setup the starting state
        if root:
            start_state = root
        else:
            start_state = State(root_eot.parent.board.copy(),
                                root_eot.parent.player.copy(),
                                root_eot.parent.opponent.copy(),
                                root_eot.parent.turn + 1, 1)
            root_eot.graft_child(start_state)
        # track states that are stable - i.e. no remaining chain reactions
        ready_for_action = [start_state]
        # simulate all actions for each state until reaching EOTs
        while ready_for_action:
            ready_state = ready_for_action.pop()
            # handle states that have run out of actions (end of turn)
            if ready_state.actions_remaining <= 0:
                root_eot = self._simulated_EOT(ready_state)
                yield root_eot
                continue  # no more simulation for an EOT
            # handle swaps when there are actions remaining
            for swap_result in self._simulated_swap_results(ready_state):
                # handle any chain reactions
                if swap_result.actions_remaining \
                        >= ready_state.actions_remaining:
                    already_used_bonus = True
                else:
                    already_used_bonus = False
                chain_result = self._simulated_chain_result(swap_result,
                                                            already_used_bonus)
                # chain results may be filtered so test first
                if chain_result:
                    ready_for_action.append(chain_result)
            #at this point all swaps have been tried
            #if nothing was valid, it's a manadrain
            if not tuple(ready_state.children):
                mana_drain_eot = self._simulated_mana_drain(ready_state)
                yield mana_drain_eot
                continue
            # if something was valid, now spells can be simulated
            else:
                pass