code: def _TerminateProcessByPid(self, pid):
      
      self._RaiseIfNotRegistered(pid)
  
      process = self._processes_per_pid[pid]
  
      self._TerminateProcess(process)
      self._StopMonitoringProcess(process)
docs: Terminate a process that's monitored by the engine.
  
      Args:
        pid (int): process identifier (PID).
  
      Raises:
        KeyError: if the process is not registered with and monitored by the
            engine.