code: def add_batch_stats(
      self, n_batches, preds, targets, scores, loss, m_input, **contexts
  ):  # contexts object is the dict returned by self.batch_context().
      super().add_batch_stats(
          n_batches, preds, targets, scores, loss, m_input, **contexts
      )
  
      # for preds
      (
          ans_list,
          ans_starts_list,
          ans_ends_list,
      ) = self._add_answer_batch_stats(m_input, preds, **contexts)
      self.aggregate_data(self.all_pred_answers, ans_list)
      self.aggregate_data(self.all_pred_starts, ans_starts_list)
      self.aggregate_data(self.all_pred_ends, ans_ends_list)
  
      # for targets
      (
          ans_list,
          ans_starts_list,
          ans_ends_list,
      ) = self._add_answer_batch_stats(m_input, targets, **contexts)
      self.aggregate_data(self.all_target_answers, ans_list)
      self.aggregate_data(self.all_target_starts, ans_starts_list)
      self.aggregate_data(self.all_target_ends, ans_ends_list)
  
imports: import re
  import string
  from typing import Dict, List, Set, Tuple, Union
  import numpy
  from pytext.common.constants import Stage
  from pytext.metric_reporters.channel import Channel, ConsoleChannel, FileChannel
  from pytext.metric_reporters.metric_reporter import MetricReporter
  from pytext.metrics.squad_metrics import SquadMetrics
  from pytext.utils.data import merge_token_labels_to_slot, parse_slot_string, Slot
  from scipy.optimize import linear_sum_assignment
label_desc: Use image node_id 5 for calling the MultiSpanQAMetricReporter obj's underlying member method code with example usage: obj.add_batch_stats(n_batches, preds, targets, scores, loss, m_input) without return types