class_docstr: MuTual: A Dataset for Multi-Turn Dialogue Reasoning
code: def _generate_examples(self, basepath, split):
      # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
      # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
      key = 0
      for file in sorted(Path(basepath).iterdir()):
          if file.suffix != ".txt":
              continue
          with open(file, "r", encoding="utf-8") as f:
              data_str = f.read()
              # Ignore the occasional empty file.
              if not data_str:
                  continue
              data = json.loads(data_str)
              yield key, {
                  "answers": data["answers"],
                  "options": data["options"],
                  "article": data["article"],
                  "id": data["id"],
              }
              key += 1
  
file_path: lm-evaluation-harness/lm_eval/datasets/mutual/mutual.py
imports: import json
  import os
  from pathlib import Path
  import datasets
label_desc: Use image node_id 3 for calling the Mutual obj's underlying member method code with example usage: obj._generate_examples(basepath, split) without return types