code: def _ref_check(self, case):
          
          refs = [bus._i for bus in case.buses if bus.type == REFERENCE]
  
          if len(refs) == 1:
              return True, refs
          else:
              logger.error("OPF requires a single reference bus.")
              return False, refs
docs: Checks that there is only one reference bus.