class_docstr: CelebA dataset. Aligned and cropped. With metadata.
class_docstr_tok: ["CelebA","dataset",".","Aligned","and","cropped",".","With","metadata","."]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(
      self, file_id, downloaded_dirs, downloaded_images
  ):
      """Yields examples."""
  
      img_list_path = downloaded_dirs["list_eval_partition"]
      landmarks_path = downloaded_dirs["landmarks_celeba"]
      attr_path = downloaded_dirs["list_attr_celeba"]
      identity_path = downloaded_dirs["identity_celeba"]
  
      with epath.Path(img_list_path).open() as f:
          files = [
              line.split()[0]
              for line in f.readlines()
              if int(line.split()[1]) == file_id
          ]
  
      attributes = self._process_celeba_config_file(attr_path)
      landmarks = self._process_celeba_config_file(landmarks_path)
      identity = self._process_celeba_nonheading_config_file(
          identity_path, IDENTITY_HEADINGS
      )
  
      for file_name in sorted(files):
          record = {
              "image": downloaded_images[file_name],
              "landmarks": {
                  k: v
                  for k, v in zip(landmarks[0], landmarks[1][file_name])
              },
              "attributes": {
                  # atributes value are either 1 or -1, so convert to bool
                  k: v > 0
                  for k, v in zip(
                      attributes[0], attributes[1][file_name]
                  )
              },
              "identity": {
                  k: v
                  for k, v in zip(identity[0], identity[1][file_name])
              },
          }
          yield file_name, record
  
file_path: datasets/tensorflow_datasets/datasets/celeb_a/celeb_a_dataset_builder.py
imports: from __future__ import annotations
  import os
  from typing import Sequence, Union
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 5 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(file_id, downloaded_dirs, downloaded_images) without return types