class_docstr: Open Images v4.
class_docstr_tok: ["Open","Images","v4","."]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(
      self, archive_paths, objects_getter, bboxes_getter, prefixes=None
  ):
      """Yields examples."""
      trainable_classes = set(
          self.info.features["objects_trainable"]["label"].names
      )
      for i, archive_path in enumerate(archive_paths):
          prefix = prefixes[i] if prefixes else None
          objects = objects_getter(prefix)
          bboxes = bboxes_getter(prefix)
          logging.info("Opening archive %s ...", archive_path)
          archive = tfds.download.iter_archive(
              archive_path, tfds.download.ExtractMethod.TAR_STREAM
          )
          for fpath, fobj in archive:
              fname = os.path.basename(fpath)
              image_id = int(os.path.splitext(fname)[0], 16)
              image_objects = [
                  obj._asdict() for obj in objects.get(image_id, [])
              ]
              image_bboxes = [
                  bbox._asdict() for bbox in bboxes.get(image_id, [])
              ]
              image_objects_trainable = [
                  obj
                  for obj in image_objects
                  if obj["label"] in trainable_classes
              ]
              record = {
                  "image": _resize_image_if_necessary(
                      fobj,
                      target_pixels=self.builder_config.target_pixels,
                  ),
                  "image/filename": fname,
                  "objects": image_objects,
                  "objects_trainable": image_objects_trainable,
                  "bobjects": image_bboxes,
              }
              yield fname, record
  
imports: from __future__ import annotations
  import collections
  import csv
  import functools
  import io
  import os
  from typing import List
  from absl import logging
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(archive_paths, objects_getter, bboxes_getter, prefixes) without return types