code: def check_answer(
      questions_answers_docs, tokenizer, match_type
  ) -> List[bool]:
      """
      Search through all the top docs to see if they have any of the answers.
      """
      answers, (doc_ids, doc_scores) = questions_answers_docs
  
      global dpr_all_documents
      hits = []
  
      for i, doc_id in enumerate(doc_ids):
          doc = dpr_all_documents[doc_id]
          text = doc[0]
  
          answer_found = False
          if text is None:  # cannot find the document for some reason
              logger.warning("no doc in db")
              hits.append(False)
              continue
  
          if has_answer(answers, text, tokenizer, match_type):
              answer_found = True
          hits.append(answer_found)
      return hits
  
file_path: megatron-lm/tasks/orqa/unsupervised/qa_utils.py
imports: import collections
  import logging
  import string
  import unicodedata
  from functools import partial
  from multiprocessing import Pool
  from typing import Tuple, List, Dict
  import regex
  from tasks.orqa.unsupervised.tokenizers import SimpleTokenizer
label_desc: Use image node_id 2 for calling a global function with example usage: check_answer(questions_answers_docs, tokenizer, match_type) and returns: hits