code: def wait_for_available(self, operation_timeout=None):
          
          if operation_timeout is None:
              operation_timeout = \
                  self.session.retry_timeout_config.operation_timeout
          if operation_timeout > 0:
              start_time = time.time()
          while True:
              try:
                  self.query_api_version()
              except Error:
                  pass
              except Exception:
                  raise
              else:
                  break
              if operation_timeout > 0:
                  current_time = time.time()
                  if current_time > start_time + operation_timeout:
                      raise OperationTimeout(
                          "Waiting for Console at {} to become available timed "
                          "out (operation timeout: {} s)".
                          format(self.session.host, operation_timeout),
                          operation_timeout)
              time.sleep(10)
docs: Wait for the Console (HMC) this client is connected to, to become
          available. The Console is considered available if the
          :meth:`~zhmcclient.Client.query_api_version` method succeeds.
  
          If the Console does not become available within the operation timeout,
          an :exc:`~zhmcclient.OperationTimeout` exception is raised.
  
          Parameters:
  
            operation_timeout (:term:`number`):
              Timeout in seconds, when waiting for the Console to become
              available. The special value 0 means that no timeout is set. `None`
              means that the default async operation timeout of the session is
              used.
  
              If the timeout expires, a :exc:`~zhmcclient.OperationTimeout`
              is raised.
  
          Raises:
  
            :exc:`~zhmcclient.OperationTimeout`: The timeout expired while
              waiting for the Console to become available.