code: def _wait_for_recv(self):
          
          while True:
              time.sleep(0.2)
              if self.session.recv_ready() or self.session.closed:
                  return
docs: After executing a command, wait for results.
          
          Because `recv_ready()` can return False, but still have a
          valid, open connection, it is not enough to ensure output
          from a command execution is properly captured.
  
          :return: None