code: def _prediction_and_confidence_scores(self, predictor: Predictor):
      def preds_and_confs_fn(data):
          data = [
              {self._context_key: pair[0], self._question_key: pair[1]}
              for pair in data
          ]
          predictions = predictor.predict_batch_json(data)
          labels = [pred[self._answer_key] for pred in predictions]
          return labels, np.ones(len(labels))
  
      return preds_and_confs_fn
  
imports: from typing import Optional, Iterable, Tuple, Union
  import itertools
  import numpy
  from checklist.editor import MunchWithAdd
  from checklist.test_suite import TestSuite
  from checklist.test_types import MFT
  from checklist.perturb import Perturb
  from allennlp.confidence_checks.task_checklists.task_suite import TaskSuite
  from allennlp.confidence_checks.task_checklists import utils
  from allennlp.predictors import Predictor
label_desc: Use image node_id 2 for calling the QuestionAnsweringSuite obj's underlying member method code with example usage: obj._prediction_and_confidence_scores(predictor) and returns: preds_and_confs_fn, labels,  np