def terminate(self, force=False):
if not self.isalive():<EOL><INDENT>return True<EOL><DEDENT>try:<EOL><INDENT>self.kill(signal.SIGHUP)<EOL>time.sleep(self.delayafterterminate)<EOL>if not self.isalive():<EOL><INDENT>return True<EOL><DEDENT>self.kill(signal.SIGCONT)<EOL>time.sleep(self.delayafterterminate)<EOL>if not self.isalive():<EOL><INDENT>return True<EOL><DEDENT>self.kill(signal.SIGINT)<EOL>time.sleep(self.delayafterterminate)<EOL>if not self.isalive():<EOL><INDENT>return True<EOL><DEDENT>if force:<EOL><INDENT>self.kill(signal.SIGKILL)<EOL>time.sleep(self.delayafterterminate)<EOL>if not self.isalive():<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return False<EOL><DEDENT>except OSError as e:<EOL><INDENT>time.sleep(self.delayafterterminate)<EOL>if not self.isalive():<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>
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.