code: def _get_reference_index(self, case):
          
          refs = [bus._i for bus in case.connected_buses if bus.type == REFERENCE]
          if len(refs) == 1:
              return refs [0]
          else:
              logger.error("Single swing bus required for DCPF.")
              return -1
docs: Returns the index of the reference bus.