code: def select_best_candidate(candidate_models):
      
      best_r_squared_adj = -np.inf
      best_candidate = None
  
      # CalTrack 3.4.3.3
      for candidate in candidate_models:
          if (
              candidate.status == "QUALIFIED"
              and candidate.r_squared_adj > best_r_squared_adj
          ):
              best_candidate = candidate
              best_r_squared_adj = candidate.r_squared_adj
  
      if best_candidate is None:
          warnings = [
              EEMeterWarning(
                  qualified_name="eemeter.caltrack_daily.select_best_candidate.no_candidates",
                  description="No qualified model candidates available.",
                  data={
                      "status_count:{}".format(status): count
                      for status, count in Counter(
                          [c.status for c in candidate_models]
                      ).items()
                  },
              )
          ]
          return None, warnings
  
      return best_candidate, []
docs: Select and return the best candidate model based on r-squared and
      qualification.
  
      Parameters
      ----------
      candidate_models : :any:`list` of :any:`eemeter.CalTRACKUsagePerDayCandidateModel`
          Candidate models to select from.
  
      Returns
      -------
      (best_candidate, warnings) : :any:`tuple` of :any:`eemeter.CalTRACKUsagePerDayCandidateModel` or :any:`None` and :any:`list` of `eemeter.EEMeterWarning`
          Return the candidate model with highest r-squared or None if none meet
          the requirements, and a list of warnings about this selection (or lack
          of selection).