def METHOD_NAME(pid, timeout):
    keyboard_interrupted = False
    time_count = 0
    # Usually, a process is killed very quickly.
    # This little nap will save 1 second.
    time.sleep(0.01)
    while True:
        try:
            # Implementation of waiting
            while time_count < timeout:
                pid_running = _check_pid_running(pid)
                if not pid_running:
                    return True
                time.sleep(1)
                time_count += 1
            return False
        except KeyboardInterrupt:
            # Warn at the first keyboard interrupt and do nothing
            # Stop at the second
            if keyboard_interrupted:
                print_warning('Wait of process killing cancelled.')
                # I think throwing an exception is more reasonable.
                # Another option is to return false here, which is also acceptable.
                raise
            print_warning(
                f'Waiting for the cleanup of a process (pid = {pid}). '
                'We suggest you waiting for it to complete. '
                'Press Ctrl-C again if you intend to interrupt the cleanup.'
            )
            keyboard_interrupted = True
    # Actually we will never reach here
    return False