def _get_compute_id(local_ips, id_to_node_ips):
 matching_instances = []
 for (server_id, api_addresses) in id_to_node_ips.items():
  if api_addresses.intersection(local_ips):
   matching_instances.append(server_id)
 if ((len(matching_instances) == 1) and matching_instances[0]):
  return matching_instances[0]
 raise KeyError("Couldn't find matching node.")

def _get_compute_id ( local_ips , id_to_node_ips ) : matching_instances = [ ] for ( server_id , api_addresses ) in id_to_node_ips . items ( ) : if api_addresses . intersection ( local_ips ) : matching_instances . append ( server_id ) if ( ( len ( matching_instances ) == 1 ) and matching_instances [ 0 ] ) : return matching_instances [ 0 ] raise KeyError ( "Couldn't find matching node." )
compute the instance id of the local machine .