code: def get_instance_property(instance, property_name):
    
  
    name = get_name(instance)
    while True:
      try:
        value = getattr(instance, property_name)
        if value is not None:
          break
        print(f"retrieving {property_name} on {name} produced None, retrying")
        time.sleep(RETRY_INTERVAL_SEC)
        instance.reload()
        continue
      except Exception as e:
        print(f"retrieving {property_name} on {name} failed with {e}, retrying")
        time.sleep(RETRY_INTERVAL_SEC)
        try:
          instance.reload()
        except Exception:
          pass
        continue
  
    return value
docs: Retrieves property of an instance, keeps retrying until getting a non-None