class_docstr: DatasetBuilder for gov_report dataset.
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, path: str, split: str):
      """Yields examples."""
      subset = self.builder_config.subset
      style = self.builder_config.style
      separator = self.builder_config.separator
      report_key, summary_key = self.builder_config.supervised_keys
      split_filename = os.path.join(
          path, "split_ids", f"{subset}_{split}.ids"
      )
      with epath.Path(split_filename).open() as f:
          for line in f:
              json_path = os.path.join(
                  path, subset, f"{line.rstrip()}.json"
              )
              with epath.Path(json_path).open() as jf:
                  d = json.load(jf)
                  if style == "json":
                      report = json.dumps(d[report_key])
                  else:
                      if subset == _SUBSET_CRS:
                          report = _flatten_structure(
                              d[report_key],
                              separator,
                              1,
                              style == "html",
                          )
                      elif subset == _SUBSET_GAO:
                          report = separator.join(
                              [
                                  _flatten_structure(
                                      r, separator, 1, style == "html"
                                  )
                                  for r in d[report_key]
                              ]
                          )
                      else:
                          raise ValueError("Unsupported subset.")
  
                  if subset == _SUBSET_CRS:
                      summary = separator.join(d[summary_key])
                  elif subset == _SUBSET_GAO:
                      summary = separator.join(
                          sum(
                              [s["paragraphs"] for s in d[summary_key]],
                              [],
                          )
                      )
                  else:
                      raise ValueError("Unsupported subset.")
                  results = {report_key: report, summary_key: ""}
                  results.update(
                      {
                          k: separator.join(d[k])
                          if isinstance(d[k], list)
                          else d[k]
                          for k in self.builder_config.other_keys
                      }
                  )
                  yield d[_ID_KEY], results
  
file_path: datasets/tensorflow_datasets/summarization/gov_report/gov_report.py
imports: import itertools
  import json
  import os
  from typing import Any, Dict, Iterable, Tuple
  from etils import epath
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the GovReport obj's underlying member method code with example usage: obj._generate_examples(path, split) without return types