code: def parse_wsc273_xml(xml_data):
      """Parse the XML file containing WSC273 examples."""
      soup = tfds.core.lazy_imports.bs4.BeautifulSoup(xml_data, "lxml")
      schemas = soup.find_all("schema")
      # Only the first 273 examples are included in WSC273.
      for i, schema in enumerate(schemas[:273]):
          txt1 = schema.find_all("txt1")[0].get_text()
          txt1 = normalize_text(txt1)
          txt2 = schema.find_all("txt2")[0].get_text()
          txt2 = normalize_text(txt2)
          pron = schema.find_all("pron")[0].get_text()
          pron = normalize_text(pron)
          answers = [
              ans.get_text().strip()
              for ans in schema.find_all("answer")
          ]
          normalized_answers = [
              normalize_cap(ans, pron) for ans in answers
          ]
          assert len(answers) == 2
          choice = (
              schema.find_all("correctanswer")[0].get_text().strip()
          )
          label = {"A": 0, "B": 1}[choice[0]]
          if len(txt2) == 1:
              # If there is only one punctuation left after the pronoun,
              # then no space should be inserted.
              text = f"{txt1} {pron}{txt2}"
          else:
              text = f"{txt1} {pron} {txt2}"
          pronoun_text = pron
          pronoun_start = len(txt1) + 1
          pronoun_end = len(txt1) + len(pron) + 1
          example = dict(
              text=text,
              pronoun_text=pronoun_text,
              pronoun_start=pronoun_start,
              pronoun_end=pronoun_end,
              option1=answers[0],
              option2=answers[1],
              option1_normalized=normalized_answers[0],
              option2_normalized=normalized_answers[1],
              label=label,
              idx=i,
          )
          assert text[pronoun_start:pronoun_end] == pronoun_text
          yield example
  
file_path: datasets/tensorflow_datasets/text/wsc273/wsc273.py
imports: from __future__ import annotations
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling a global function with example usage: parse_wsc273_xml(xml_data) without return types