class_docstr: A component that locates and extract answers to a given query from Documents. It's used for performing extractive
  QA. The Reader assigns a score to every possible answer span independently of other answer spans.
  This fixes a common issue of other implementations which make comparisons across documents harder by normalizing
  each document's answers independently.
  
  Example usage:
  ```python
  p = Pipeline()
  p.add_component(instance=InMemoryBM25Retriever(document_store=InMemoryDocumentStore()), name="retriever")
  p.add_component(instance=ExtractiveReader(), name="reader")
  p.connect("retriever", "reader")
  question = "Who lives in Berlin?"
  p.run({"retriever": {"query": question}, "reader": {"query": question}})
  ```
docstr: Flattens queries and Documents so all query-document pairs are arranged along one batch axis.
docstr_tok: ["Flattens","queries","and","Documents","so","all","query-document","pairs","are","arranged","along","one","batch","axis","."]
code: def _flatten_documents(
      self, queries: List[str], documents: List[List[Document]]
  ) -> Tuple[List[str], List[Document], List[int]]:
      """
      Flattens queries and Documents so all query-document pairs are arranged along one batch axis.
      """
      flattened_queries = [
          query
          for documents_, query in zip(documents, queries)
          for _ in documents_
      ]
      flattened_documents = [
          document
          for documents_ in documents
          for document in documents_
      ]
      query_ids = [
          i
          for i, documents_ in enumerate(documents)
          for _ in documents_
      ]
      return flattened_queries, flattened_documents, query_ids
  
imports: from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple, Union
  import math
  import warnings
  import logging
  from haystack import component, default_to_dict, default_from_dict, ComponentError, Document, ExtractedAnswer
  from haystack.lazy_imports import LazyImport
  from haystack.utils import get_device
label_desc: Use image node_id 6 for calling the ExtractiveReader obj's underlying member method code with example usage: obj._flatten_documents(queries, documents) and returns: flattened_queries,  flattened_documents,  query_ids