code: def _index_buses(self, buses):
          
          refs = [bus._i for bus in buses if bus.type == REFERENCE]
  #        if len(refs) != 1:
  #            raise SlackBusError
          pv = [bus._i for bus in buses if bus.type == PV]
          pq = [bus._i for bus in buses if bus.type == PQ]
          pvpq = pv + pq
  
          return refs, pq, pv, pvpq
docs: Set up indexing for updating v.