<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_state_machine(self):
 """Get a reference of the state_machine the state belongs to :rtype rafcon.core.state_machine.StateMachine :return: respective state machine """

        if self.parent:
            if self.is_root_state:
                return self.parent
            else:
                return self.parent.get_state_machine()

        return None