def reformat_node(item=None, full=False):
 desired_keys = ['id', 'name', 'state', 'public_ips', 'private_ips', 'size', 'image', 'location']
 item['private_ips'] = []
 item['public_ips'] = []
 if ('ips' in item):
  for ip in item['ips']:
   if is_public_ip(ip):
    item['public_ips'].append(ip)
   else:
    item['private_ips'].append(ip)
 for key in desired_keys:
  if (key not in item):
   item[key] = None
 to_del = []
 if (not full):
  for key in six.iterkeys(item):
   if (key not in desired_keys):
    to_del.append(key)
 for key in to_del:
  del item[key]
 if ('state' in item):
  item['state'] = joyent_node_state(item['state'])
 return item

def reformat_node ( item = None , full = False ) : desired_keys = [ 'id' , 'name' , 'state' , 'public_ips' , 'private_ips' , 'size' , 'image' , 'location' ] item [ 'private_ips' ] = [ ] item [ 'public_ips' ] = [ ] if ( 'ips' in item ) : for ip in item [ 'ips' ] : if is_public_ip ( ip ) : item [ 'public_ips' ] . append ( ip ) else : item [ 'private_ips' ] . append ( ip ) for key in desired_keys : if ( key not in item ) : item [ key ] = None to_del = [ ] if ( not full ) : for key in six . iterkeys ( item ) : if ( key not in desired_keys ) : to_del . append ( key ) for key in to_del : del item [ key ] if ( 'state' in item ) : item [ 'state' ] = joyent_node_state ( item [ 'state' ] ) return item
reformat the returned data from joyent .