

def GetEntityViaMemcache(entity_key):
    'Get entity from memcache if available, from datastore if not.'
    entity = memcache.get(entity_key)
    if (entity is not None):
        return entity
    key = ndb.Key(urlsafe=entity_key)
    entity = key.get()
    if (key is not None):
        memcache.set(entity_key, entity)
    return entity

dataset/ETHPy150Open GoogleCloudPlatform/python-docs-samples/appengine/localtesting/datastore_test.py GetEntityViaMemcache/VarMisuse@56/92 `entity`->`key`