def _get_ips(networks):
 v4s = networks.get('v4')
 v6s = networks.get('v6')
 public_ips = []
 private_ips = []
 if v4s:
  for item in v4s:
   ip_type = item.get('type')
   ip_address = item.get('ip_address')
   if (ip_type == 'public'):
    public_ips.append(ip_address)
   if (ip_type == 'private'):
    private_ips.append(ip_address)
 if v6s:
  for item in v6s:
   ip_type = item.get('type')
   ip_address = item.get('ip_address')
   if (ip_type == 'public'):
    public_ips.append(ip_address)
   if (ip_type == 'private'):
    private_ips.append(ip_address)
 return (public_ips, private_ips)

def _get_ips ( networks ) : v4s = networks . get ( 'v4' ) v6s = networks . get ( 'v6' ) public_ips = [ ] private_ips = [ ] if v4s : for item in v4s : ip_type = item . get ( 'type' ) ip_address = item . get ( 'ip_address' ) if ( ip_type == 'public' ) : public_ips . append ( ip_address ) if ( ip_type == 'private' ) : private_ips . append ( ip_address ) if v6s : for item in v6s : ip_type = item . get ( 'type' ) ip_address = item . get ( 'ip_address' ) if ( ip_type == 'public' ) : public_ips . append ( ip_address ) if ( ip_type == 'private' ) : private_ips . append ( ip_address ) return ( public_ips , private_ips )
helper function for list_nodes .