Reading the new documentation of GAE NDB Datastore: https://cloud.google.com/appengine/docs/python/ndb/modelclass#class_methods
get_by_id(id, parent
Currently, ndb doesn't use the Cloud Datastore API and in its normal mode of operation can't connect to another app's Datastore - it connects natively to the Datastore of the app the code is running on.
You can, however, use the remote api to have ndb connect to the Datastores of different apps from the development environment.
There is currently [an open Feature Request in the Public Issue Tracker for App Engine for the possibility of accessing multiple Datastores from a single app. Feel free to post a Feature Request for ndb specifically, although from the following comments in the source it appears this is already something that's being worked-on:
current_app_id = os.environ.get('APPLICATION_ID', None)
if current_app_id and current_app_id != app_id:
# TODO(pcostello): We should support this so users can connect to different
# applications.
raise ValueError('Cannot create a Cloud Datastore context that connects '
'to an application (%s) that differs from the application '
'already connected to (%s).' % (app_id, current_app_id))
os.environ['APPLICATION_ID'] = app_id