<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def execute_state_machine_from_path(self, state_machine=None, path=None, start_state_path=None, wait_for_execution_finished=True):
 """ A helper function to start an arbitrary state machine at a given path. :param path: The path where the state machine resides :param start_state_path: The path to the state from which the execution will start :return: a reference to the created state machine """


        import rafcon.core.singleton
        from rafcon.core.storage import storage
        rafcon.core.singleton.library_manager.initialize()
        if not state_machine:
            state_machine = storage.load_state_machine_from_path(path)
            rafcon.core.singleton.state_machine_manager.add_state_machine(state_machine)

        rafcon.core.singleton.state_machine_execution_engine.start(
            state_machine.state_machine_id, start_state_path=start_state_path)

        if wait_for_execution_finished:
            self.join()
            self.stop()
        return state_machine