def get_keys(keynames=None, filters=None, region=None, key=None, keyid=None, profile=None):
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 try:
  keys = conn.get_all_key_pairs(keynames, filters)
  log.debug('the key to return is : {0}'.format(keys))
  key_values = []
  if keys:
   for key in keys:
    key_values.append(key.name)
  return key_values
 except boto.exception.BotoServerError as e:
  log.debug(e)
  return False

def get_keys ( keynames = None , filters = None , region = None , key = None , keyid = None , profile = None ) : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) try : keys = conn . get_all_key_pairs ( keynames , filters ) log . debug ( 'the key to return is : {0}' . format ( keys ) ) key_values = [ ] if keys : for key in keys : key_values . append ( key . name ) return key_values except boto . exception . BotoServerError as e : log . debug ( e ) return False
for cross compatibility between python 2 and python 3 dictionaries .