def _convert_key_to_str(key):
 if isinstance(key, six.text_type):
  return str(key)
 return key

def _convert_key_to_str ( key ) : if isinstance ( key , six . text_type ) : return str ( key ) return key
stolen completely from boto .