def get_ip(data):
 try:
  ip = data.public_ips[0]
 except Exception:
  ip = data.private_ips[0]
 return ip

def get_ip ( data ) : try : ip = data . public_ips [ 0 ] except Exception : ip = data . private_ips [ 0 ] return ip
return the ip associated with the named host cli example: .