code: def wait_until_available(resource):
    
    while True:
      resource.load()
      if resource.state == 'available':
        break
      time.sleep(RETRY_INTERVAL_SEC)
docs: Waits until interval state becomes 'available