def METHOD_NAME(self, inputs: List[dict], top_k_join: Optional[int] = None):  # type: ignore
    results = [inp["documents"] for inp in inputs]
    document_map = {doc.id: doc for result in results for doc in result}
    if self.join_mode == "concatenate":
        scores_map = self._concatenate_results(results)
    elif self.join_mode == "merge":
        scores_map = self._calculate_comb_sum(results)
    elif self.join_mode == "reciprocal_rank_fusion":
        scores_map = self._calculate_rrf(results)
    else:
        raise ValueError(f"Invalid join_mode: {self.join_mode}")
    # only sort the docs if that was requested
    if self.sort_by_score:
        sorted_docs = sorted(scores_map.items(), key=lambda d: d[1] if d[1] is not None else -inf, reverse=True)
        if any(s is None for s in scores_map.values()):
            logger.info(
                "The `JoinDocuments` node has received some documents with `score=None` - and was requested "
                "to sort the documents by score, so the `score=None` documents got sorted as if their "
                "score would be `-infinity`."
            )
    else:
        sorted_docs = [(k, v) for k, v in scores_map.items()]
    if not top_k_join:
        top_k_join = self.top_k_join
    if not top_k_join:
        top_k_join = len(sorted_docs)
    docs = []
    for id, score in sorted_docs[:top_k_join]:
        doc = document_map[id]
        doc.score = score
        docs.append(doc)
    output = {"documents": docs, "labels": inputs[0].get("labels", None)}
    return output, "output_1"