<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_task_external(self, coroutine):
 """Inject a task into the emulation loop and wait for it to finish. The coroutine parameter is run as a Task inside the EmulationLoop until it completes and the return value (or any raised Exception) is pased back into the caller's thread. Args: coroutine (coroutine):
 The task to inject into the event loop. Returns: object: Whatever the coroutine returned. """


        self.verify_calling_thread(False, 'run_task_external must not be called from the emulation thread')

        future = asyncio.run_coroutine_threadsafe(coroutine, self._loop)
        return future.result()