code: def test_flatten_documents(mock_reader: ExtractiveReader):
      queries, docs, query_ids = mock_reader._flatten_documents(
          example_queries, example_documents
      )
      i = 0
      for j, query in enumerate(example_queries):
          for doc in example_documents[j]:
              assert queries[i] == query
              assert docs[i] == doc
              assert query_ids[i] == j
              i += 1
      assert len(docs) == len(queries) == len(query_ids) == i
  
imports: from math import ceil, exp
  from typing import List
  from unittest.mock import patch, Mock
  import pytest
  import torch
  from transformers import pipeline
  from haystack.components.readers import ExtractiveReader
  from haystack import Document, ExtractedAnswer
label_desc: Use image node_id 7 for calling a global function with example usage: test_flatten_documents(mock_reader) without return types