code: def extract_answer_text(options_text: str, answer_tag: str):
      """Extracts correct answer's text from all options.
  
      Args:
        options_text: all options as text in various format.
        answer_tag: correct answers tag a, b, c, ...
  
      Returns:
        parsed option text corresponding to the correct answer.
      """
      if options_text.startswith("[") and options_text.endswith("]"):
          options = eval(options_text)  # pylint: disable = eval-used
          options = [
              re.sub("[abcde] \\)", "", x).strip() for x in options
          ]
      else:
          options = re.split("[abcde] \\)", options_text)
          if options[0]:
              raise ValueError(
                  f"Expects first segment to be empty in {options}."
              )
          options = [x.strip().rstrip(",").strip() for x in options[1:]]
      correct_id = ord(answer_tag) - ord("a")
      if correct_id >= len(options):
          raise ValueError(
              f"Ill parsed dictionary {options} from {options_text}."
          )
      return options[correct_id]
  
file_path: datasets/tensorflow_datasets/datasets/math_qa/math_qa_dataset_builder.py
imports: import json
  import os
  import re
  from etils import epath
  import tensorflow_datasets.public_api
label_desc: Use image node_id 1 for calling a global function with example usage: extract_answer_text(options_text, answer_tag) and returns: options