code: def _TerminateProcess(self, process):
      
      pid = process.pid
      logger.warning('Terminating process: (PID: {0:d}).'.format(pid))
      process.terminate()
  
      # Wait for the process to exit.
      process.join(timeout=self._PROCESS_JOIN_TIMEOUT)
  
      if process.is_alive():
        logger.warning('Killing process: (PID: {0:d}).'.format(pid))
        self._KillProcess(pid)
docs: Terminate a process.
  
      Args:
        process (MultiProcessBaseProcess): process to terminate.