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

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