<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_subtask(self, cor, name=None, stop_timeout=1.0):
 """Create and add a subtask from a coroutine. This function will create a BackgroundTask and then call self.add_subtask() on it. Args: cor (coroutine):
 The coroutine that should be wrapped in a background task. name (str):
 An optional name for the task. stop_timeout (float):
 The maximum time to wait for this subtask to die after stopping it. Returns: Backgroundtask: The created subtask. """


        if self.stopped:
            raise InternalError("Cannot add a subtask to a parent that is already stopped")

        subtask = BackgroundTask(cor, name, loop=self._loop, stop_timeout=stop_timeout)
        self.add_subtask(subtask)
        return subtask