<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_if_outcome_already_connected(self, from_state_id, from_outcome):
 """ check if outcome of from state is not already connected :param from_state_id: The source state of the transition :param from_outcome: The outcome of the source state to connect the transition to :raises exceptions.AttributeError: if the outcome of the state with the state_id==from_state_id is already connected """

        for trans_key, transition in self.transitions.items():
            if transition.from_state == from_state_id:
                if transition.from_outcome == from_outcome:
                    raise AttributeError("Outcome %s of state %s is already connected" %
                                         (str(from_outcome), str(from_state_id)))