

def pb_to_index(self, pb):
    index_def = pb.definition()
    properties = [IndexProperty(name=prop.name(), direction=_DIR_MAP[prop.direction()]) for prop in index_def.property_list()]
    index = Index(kind=index_def.entity_type(), properties=properties, ancestor=bool(index_def.ancestor()))
    index_state = IndexState(definition=pb, state=_STATE_MAP[pb.state()], id=pb.id())
    return index_state

dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py ModelAdapter.pb_to_index/VarMisuse@88/107 `index`->`pb`