def ConvertKeys(keys):
 def ChangeApp(key, app_id):
  if (key.app() == app_id):
   return key
  return datastore.Key.from_path(namespace=key.namespace(), _app=app_id, *key.to_path())
 app_id = datastore.Key.from_path('kind', 'name').app()
 return [ChangeApp(key, app_id) for key in keys]

def ConvertKeys ( keys ) : def ChangeApp ( key , app_id ) : if ( key . app ( ) == app_id ) : return key return datastore . Key . from_path ( namespace = key . namespace ( ) , _app = app_id , * key . to_path ( ) ) app_id = datastore . Key . from_path ( 'kind' , 'name' ) . app ( ) return [ ChangeApp ( key , app_id ) for key in keys ]
convert a list of keys to a list of keys with the app_id of the caller .