def METHOD_NAME(self, timeout=None, step=0.25):
    logger.trace("Waiting for process to disappear: timeout=%s" % timeout)
    if self.check_pid():
        if timeout is None:
            return False
        t = 0
        while t < timeout:
            sleep(step)
            if not self.check_pid():
                break
            t += step
        if t >= timeout:
            logger.trace(
                "Timeout: Process %s takes too long to " "disappear." % self._pid
            )
            return False
    self.cleanup_pid()
    return True