code: def _results_to_docs_and_scores(
      results: Any,
  ) -> List[Tuple[Document, float]]:
      return [
          # TODO: Chroma can do batch querying,
          # we shouldn't hard code to the 1st result
          (
              Document(
                  page_content=result[0], metadata=result[1] or {}
              ),
              result[2],
          )
          for result in zip(
              results["documents"][0],
              results["metadatas"][0],
              results["distances"][0],
          )
      ]
  
imports: from __future__ import annotations
  import logging
  import uuid
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Type
  import numpy
  from langchain.docstore.document import Document
  from langchain.embeddings.base import Embeddings
  from langchain.utils import xor_args
  from langchain.vectorstores.base import VectorStore
  from langchain.vectorstores.utils import maximal_marginal_relevance
label_desc: Use image node_id 2 for calling a global function with example usage: _results_to_docs_and_scores(results) and returns: unknown