

def _db_get_value(self, v, unused_p):
    if (not v.has_referencevalue()):
        return None
    ref = entity_pb.Reference()
    rv = v.referencevalue()
    if rv.has_app():
        ref.set_app(rv.app())
    if rv.has_name_space():
        ref.set_name_space(rv.name_space())
    path = ref.mutable_path()
    for elem in rv.pathelement_list():
        path.add_element().CopyFrom(elem)
    return Key(reference=ref)

dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py KeyProperty._db_get_value/original