code: def generate_squadlike_examples(filepath):
      """Parses a SQuAD-like JSON, yielding examples with `squadlike_features`."""
      logging.info("generating examples from = %s", filepath)
  
      # We first re-group the answers, which may be flattened (e.g., by XTREME).
      qas = {}
      with epath.Path(filepath).open() as f:
          squad = json.load(f)
          for article in squad["data"]:
              title = article.get("title", "")
              for paragraph in article["paragraphs"]:
                  context = paragraph["context"]
                  for qa in paragraph["qas"]:
                      qa["title"] = title
                      qa["context"] = context
                      id_ = qa["id"]
                      if id_ in qas:
                          qas[id_]["answers"].extend(qa["answers"])
                      else:
                          qas[id_] = qa
  
          for id_, qa in qas.items():
              answer_starts = [
                  answer["answer_start"] for answer in qa["answers"]
              ]
              answers = [answer["text"] for answer in qa["answers"]]
              yield id_, {
                  "title": qa["title"],
                  "context": qa["context"],
                  "question": qa["question"],
                  "id": id_,
                  "answers": {
                      "answer_start": answer_starts,
                      "text": answers,
                  },
              }
  
file_path: datasets/tensorflow_datasets/question_answering/qa_utils.py
imports: from __future__ import annotations
  import json
  from absl import logging
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling a global function with example usage: generate_squadlike_examples(filepath) without return types