class_docstr: The SuperGLUE benchmark.
class_docstr_tok: ["The","SuperGLUE","benchmark","."]
code: def _generate_examples(self, data_file, split):
      with epath.Path(data_file).open() as f:
          for line in f:
              row = json.loads(line)
  
              if self.builder_config.name == "multirc":
                  paragraph = row["passage"]
                  for question in paragraph["questions"]:
                      for answer in question["answers"]:
                          label = answer.get("label")
                          key = "%s_%s_%s" % (
                              row["idx"],
                              question["idx"],
                              answer["idx"],
                          )
                          yield key, {
                              "paragraph": paragraph["text"],
                              "question": question["question"],
                              "answer": answer["text"],
                              "label": -1
                              if label is None
                              else _cast_label(bool(label)),
                              "idx": {
                                  "paragraph": row["idx"],
                                  "question": question["idx"],
                                  "answer": answer["idx"],
                              },
                          }
              elif self.builder_config.name == "record":
                  passage = row["passage"]
                  for qa in row["qas"]:
                      yield qa["idx"], {
                          "passage": passage["text"],
                          "query": qa["query"],
                          "entities": _get_record_entities(passage),
                          "answers": _get_record_answers(qa),
                          "idx": {
                              "passage": row["idx"],
                              "query": qa["idx"],
                          },
                      }
              else:
                  if self.builder_config.name.startswith("wsc"):
                      row.update(row["target"])
                  example = {
                      feature: row[feature]
                      for feature in self.builder_config.features
                  }
                  if self.builder_config.name == "wsc.fixed":
                      example = _fix_wst(example)
                  example["idx"] = row["idx"]
  
                  if "label" in row:
                      if self.builder_config.name == "copa":
                          example["label"] = (
                              "choice2" if row["label"] else "choice1"
                          )
                      else:
                          example["label"] = _cast_label(row["label"])
                  else:
                      assert split == tfds.Split.TEST, row
                      example["label"] = -1
                  yield example["idx"], example
  
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 3 for calling the SuperGlue obj's underlying member method code with example usage: obj._generate_examples(data_file, split) without return types