code: def _fix_wst(ex):
      """Fixes most cases where spans are not actually substrings of text."""
  
      def _fix_span_text(k):
          """Fixes a single span."""
          text = ex[k + "_text"]
          index = ex[k + "_index"]
  
          if text in ex["text"]:
              return
  
          if text in (
              "Kamenev and Zinoviev",
              "Kamenev, Zinoviev, and Stalin",
          ):
              # There is no way to correct these examples since the subjects have
              # intervening text.
              return
  
          if "theyscold" in text:
              ex["text"].replace(
                  "theyscold", "they scold"
              )  # pytype: disable=attribute-error
              ex["span2_index"] = 10
          # Make sure case of the first words match.
          first_word = ex["text"].split()[
              index
          ]  # pytype: disable=attribute-error
          if first_word[0].islower():
              text = text[0].lower() + text[1:]
          else:
              text = text[0].upper() + text[1:]
          # Remove punctuation in span.
          text = text.rstrip(".")
          # Replace incorrect whitespace character in span.
          text = text.replace("\n", " ")
          ex[k + "_text"] = text
          assert ex[k + "_text"] in ex["text"], ex
  
      _fix_span_text("span1")
      _fix_span_text("span2")
      return ex
  
file_path: datasets/tensorflow_datasets/text/super_glue.py
imports: from __future__ import annotations
  import json
  import os
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 1 for calling a global function with example usage: _fix_wst(ex) and returns: ex