class_docstr: This class represents a process running in a pseudoterminal.
  
  The main constructor is the :meth:`spawn` classmethod.
docstr: This forces a child process to terminate. It starts nicely with
  SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This
  returns True if the child was terminated. This returns False if the
  child could not be terminated. 
docstr_tok: ["This","forces","a","child","process","to","terminate",".","It","starts","nicely","with","SIGHUP","and","SIGINT",".","If","``","force","''","is","True","then","moves","onto","SIGKILL",".","This","returns","True","if","the","child","was","terminated",".","This","returns","False","if","the","child","could","not","be","terminated","."]
code: def terminate(self, force=False):
      """This forces a child process to terminate. It starts nicely with
      SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This
      returns True if the child was terminated. This returns False if the
      child could not be terminated."""
  
      if not self.isalive():
          return True
      try:
          self.kill(signal.SIGHUP)
          time.sleep(self.delayafterterminate)
          if not self.isalive():
              return True
          self.kill(signal.SIGCONT)
          time.sleep(self.delayafterterminate)
          if not self.isalive():
              return True
          self.kill(signal.SIGINT)
          time.sleep(self.delayafterterminate)
          if not self.isalive():
              return True
          if force:
              self.kill(signal.SIGKILL)
              time.sleep(self.delayafterterminate)
              if not self.isalive():
                  return True
              else:
                  return False
          return False
      except OSError:
          # I think there are kernel timing issues that sometimes cause
          # this to happen. I think isalive() reports True, but the
          # process is dead to the kernel.
          # Make one last attempt to see if the kernel is up to date.
          time.sleep(self.delayafterterminate)
          if not self.isalive():
              return True
          else:
              return False
  
imports: import codecs
  import errno
  import fcntl
  import io
  import os
  import pty
  import resource
  import signal
  import struct
  import sys
  import termios
  import time
  from pty import STDIN_FILENO, CHILD
  from .util import which, PtyProcessError
label_desc: Use image node_id 22 for calling the PtyProcess obj's underlying member method code with example usage: obj.terminate(force) and returns: True, False, True, True, True, True, False, True, False