code: def add_subtask(self, subtask):
          
  
          if self.stopped:
              raise InternalError("Cannot add a subtask to a parent that is already stopped")
  
          if not isinstance(subtask, BackgroundTask):
              raise ArgumentError("Subtasks must inherit from BackgroundTask, task={}".format(subtask))
  
          #pylint:disable=protected-access;It is the same class as us so is equivalent to self access.
          if subtask._loop != self._loop:
              raise ArgumentError("Subtasks must run in the same BackgroundEventLoop as their parent",
                                  subtask=subtask, parent=self)
  
          self.subtasks.append(subtask)
docs: Link a subtask to this parent task.
  
          This will cause stop() to block until the subtask has also
          finished.  Calling stop will not directly cancel the subtask.
          It is expected that your finalizer for this parent task will
          cancel or otherwise stop the subtask.
  
          Args:
              subtask (BackgroundTask): Another task that will be stopped
                  when this task is stopped.