code: async def stop(self, force: bool=False) -> None:
          '''Cancel the task if it hasn't yet started, or tell it to
          gracefully stop running if it has.'''
  
          Log.debug('stopping task %s', self.name)
          self.running = False
  
          if force:
              self.task.cancel(ync def stop(self, force: bool=False) -> None:
          '''Cancel the task if it hasn't yet started, or tell it to
          gracefully stop running if it has.'''
  
          Log.debug('stopping task %s', self.name)
          self.running = False
  
          if force:
              self.task.cancel()
docs: Cancel the task if it hasn't yet started, or tell it to
          gracefully stop running if it has.