code: def test_output(mock_reader: ExtractiveReader):
      answers = mock_reader.run(
          example_queries[0], example_documents[0], top_k=3
      )[
          "answers"
      ]  # [0] Uncomment and remove first two indices when batching support is reintroduced
      doc_ids = set()
      no_answer_prob = 1
      for doc, answer in zip(example_documents[0], answers[:3]):
          assert answer.document_offset.start == 11
          assert answer.document_offset.end == 16
          assert doc.content is not None
          assert answer.data == doc.content[11:16]
          assert answer.score == pytest.approx(
              1 / (1 + exp(-2 * mock_reader.calibration_factor))
          )
          no_answer_prob *= 1 - answer.score
          doc_ids.add(doc.id)
      assert len(doc_ids) == 3
      assert answers[-1].score == pytest.approx(no_answer_prob)
  
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 6 for calling a global function with example usage: test_output(mock_reader) without return types