code: def stop(self, timeout=15):
          
          pp = self.pid
          if pp:
              try:
                  kill_process_nicely(pp, timeout=timeout)
              except psutil.NoSuchProcess:
                  pass
docs: Stop the subprocess.
  
          Keyword Arguments
  
          **timeout**
            Time in seconds to wait for a process and its
            children to exit.