code: def test_decode_best_spans(self):
      tokenizer = self.tokenizer_class.from_pretrained(
          "bert-base-uncased"
      )
  
      text_1 = tokenizer.encode(
          "question sequence", add_special_tokens=False
      )
      text_2 = tokenizer.encode(
          "title sequence", add_special_tokens=False
      )
      text_3 = tokenizer.encode(
          "text sequence " * 4, add_special_tokens=False
      )
      input_ids = [[101] + text_1 + [102] + text_2 + [102] + text_3]
      reader_input = BatchEncoding({"input_ids": input_ids})
  
      start_logits = [[0] * len(input_ids[0])]
      end_logits = [[0] * len(input_ids[0])]
      relevance_logits = [0]
      reader_output = DPRReaderOutput(
          start_logits, end_logits, relevance_logits
      )
  
      start_index, end_index = 8, 9
      start_logits[0][start_index] = 10
      end_logits[0][end_index] = 10
      predicted_spans = tokenizer.decode_best_spans(
          reader_input, reader_output
      )
      self.assertEqual(predicted_spans[0].start_index, start_index)
      self.assertEqual(predicted_spans[0].end_index, end_index)
      self.assertEqual(predicted_spans[0].doc_id, 0)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/tests/models/dpr/test_tokenization_dpr.py
imports: from transformers import DPRContextEncoderTokenizer, DPRContextEncoderTokenizerFast, DPRQuestionEncoderTokenizer, DPRQuestionEncoderTokenizerFast, DPRReaderOutput, DPRReaderTokenizer, DPRReaderTokenizerFast
  from transformers.testing_utils import require_tokenizers, slow
  from transformers.tokenization_utils_base import BatchEncoding
  from ..bert.test_tokenization_bert import BertTokenizationTest
label_desc: Use image node_id 1 for calling the DPRReaderTokenizationTest obj's underlying member method code with example usage: obj.test_decode_best_spans() without return types