code: def _eval_templates(self, period):
          
          theta_best = [self._optimize(period, tmpid)
                        for tmpid, _ in enumerate(self.templates)]
          chi2 = [self._chi2(theta, period, tmpid)
                  for tmpid, theta in enumerate(theta_best)]
  
          return theta_best, chi2
docs: Evaluate the best template for the given period