code: def stop(self, sig=None, timeout=10):
          
          if self.process is None:
              return self
  
          if sig is None:
              sig = self._sig_stop
  
          try:
              os.killpg(self.process.pid, sig)
          except OSError as err:
              if err.errno in IGNORED_ERROR_CODES:
                  pass
              else:
                  raise
  
          def process_stopped():
              """Return True only only when self.process is not running."""
              return self.running() is False
  
          self._set_timeout(timeout)
          try:
              self.wait_for(process_stopped)
          except TimeoutExpired:
              log.warning('Timeout expired, killing process', process=self)
              pass
  
          self._kill_all_kids(sig)
          self._clear_process()
          return self
docs: Copy paste job from `SimpleExecutor.stop()` to add the `timeout` parameter.