class_docstr: Machine translations of the MNLI dataset.
code: def _generate_examples(self, dl_dirs):
      rows_per_pair_id = collections.defaultdict(list)
      en_pair_to_id = {}
      for lang in _LANGUAGES:
          # Translations are only for non-English languages.
          if lang == "en":
              continue
          with tf.io.gfile.GFile(dl_dirs[lang]) as f:
              reader = csv.reader(
                  f, delimiter="\t", quoting=csv.QUOTE_NONE
              )
              for row in reader:
                  (
                      en_sent1,
                      en_sent2,
                      translated_sent1,
                      translated_sent2,
                      label,
                  ) = row
                  # Change XTREME's label to conform with eval data.
                  if label == "contradictory":
                      label = "contradiction"
                  key = (en_sent1, en_sent2)
                  if key not in en_pair_to_id:
                      en_pair_to_id[key] = len(en_pair_to_id)
                      rows_per_pair_id[key].append(
                          {
                              "language": "en",
                              "sentence1": en_sent1,
                              "sentence2": en_sent2,
                              "gold_label": label,
                              "pairID": en_pair_to_id[key],
                          }
                      )
                  pair_id = en_pair_to_id[key]
                  row = {
                      "language": lang,
                      "sentence1": translated_sent1,
                      "sentence2": translated_sent2,
                      "gold_label": label,
                      "pairID": pair_id,
                  }
                  rows_per_pair_id[key].append(row)
  
      for rows in rows_per_pair_id.values():
          premise = {row["language"]: row["sentence1"] for row in rows}
          hypothesis = {
              row["language"]: row["sentence2"] for row in rows
          }
          yield rows[0]["pairID"], {
              "premise": premise,
              "hypothesis": hypothesis,
              "label": rows[0]["gold_label"],
          }
  
file_path: datasets/tensorflow_datasets/text/xtreme_xnli/xtreme_xnli.py
imports: import collections
  import csv
  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 XtremeXnli obj's underlying member method code with example usage: obj._generate_examples(dl_dirs) without return types