<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_reference_index(self, case):
 """ Returns the index of the reference bus. """

        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