code: def recommend(self, client_data, limit, extra_data={}):
          preinstalled_addon_ids = client_data.get("installed_addons", [])
          extended_limit = limit + len(preinstalled_addon_ids)
          ensemble_suggestions = self._ensemble_recommender.recommend(
              client_data, extended_limit, extra_data
          )
          curated_suggestions = self._curated_recommender.recommend(
              client_data, extended_limit, extra_data
          )
          merged_results = set()
          while (
              len(merged_results) < limit
              and len(ensemble_suggestions) > 0
              and len(curated_suggestions) > 0
          ):
              r1 = ensemble_suggestions.pop()
              if r1[0] not in [temp[0] for temp in merged_results]:
                  merged_results.add(r1)
              if not (
                  len(merged_results) < limit
                  and len(ensemble_suggestions) > 0
                  and len(curated_suggestions) > 0
              ):
                  break
              r2 = curated_suggestions.pop()
              if r2[0] not in [temp[0] for temp in merged_results]:
                  merged_results.add(r2)
          if len(merged_results) < limit:
              msg = (
                  "Defaulting to empty results. Insufficient recommendations found for client: %s"
                  % client_data["client_id"]
              )
              self.logger.info(msg)
              return []
          sorted_results = sorted(
              list(merged_results), key=op.itemgetter(1), reverse=True
          )
          log_data = (client_data["client_id"], str([r[0] for r in sorted_results]))
          self.logger.info(
              "Hybrid recommendations client_id: [%s], guids: [%s]" % log_data
          )
          return sorted_results