code: def _answer_to_bags(
      self, answer: Union[str, List[str], Tuple[str, ...]]
  ) -> Tuple[List[str], List[Set[str]]]:
      if isinstance(answer, (list, tuple)):
          raw_spans = answer
      else:
          raw_spans = [answer]
      normalized_spans: List[str] = []
      token_bags = []
      for raw_span in raw_spans:
          normalized_span = self._normalize_answer(raw_span)
          normalized_spans.append(normalized_span)
          token_bags.append(set(normalized_span.split()))
      return normalized_spans, token_bags
  
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 14 for calling the MultiSpanQAMetricReporter obj's underlying member method code with example usage: obj._answer_to_bags(answer) and returns: normalized_spans,  token_bags