code: def wait(self, timeout_ms=None):
      
      closed = timeouts.loop_until_timeout_or_true(
          timeouts.PolledTimeout.from_millis(timeout_ms),
          self.stream.is_closed, .1)
      if closed:
        if hasattr(self.stdout, 'getvalue'):
          return self.stdout.getvalue()
        return True
      return None
docs: Block until this command has completed.
  
      Args:
        timeout_ms: Timeout, in milliseconds, to wait.
  
      Returns:
        Output of the command if it complete and self.stdout is a StringIO
      object or was passed in as None.  Returns True if the command completed but
      stdout was provided (and was not a StringIO object).  Returns None if the
      timeout expired before the command completed.  Be careful to check the
      return value explicitly for None, as the output may be ''.