class_docstr: Pet Finder.
class_docstr_tok: ["Pet","Finder","."]
docstr: Yields examples.
  
  Args:
    csv_name: file name for the csv file used in the split
    csv_paths: Path to csv files containing the label and attributes
      information.
    img_paths: Path to images.
docstr_tok: ["Yields","examples",".","Args",":","csv_name",":","file","name","for","the","csv","file","used","in","the","split","csv_paths",":","Path","to","csv","files","containing","the","label","and","attributes","information",".","img_paths",":","Path","to","images","."]
code: def _generate_examples(self, csv_name, csv_paths, img_paths):
      """Yields examples.
  
      Args:
        csv_name: file name for the csv file used in the split
        csv_paths: Path to csv files containing the label and attributes
          information.
        img_paths: Path to images.
      """
      pd = tfds.core.lazy_imports.pandas
  
      if not tf.io.gfile.exists(csv_paths):
          raise AssertionError("{} not exist".format(csv_name))
      with epath.Path(csv_paths).open() as csv_file:
          dataframe = pd.read_csv(csv_file)
      # add a dummy label for test set
      if csv_name == "test.csv":
          dataframe["AdoptionSpeed"] = -1
  
      images = tf.io.gfile.listdir(img_paths)
      for image in images:
          pet_id = image.split("-")[0]
          image_path = os.path.join(img_paths, image)
          attr_dict = dataframe.loc[dataframe["PetID"] == pet_id]
          record = {
              "image": image_path,
              "image/filename": image,
              "PetID": pet_id,
              "attributes": attr_dict[_INT_FEATS].to_dict("records")[0],
              "label": attr_dict["AdoptionSpeed"].values[0],
          }
          yield image, record
  
file_path: datasets/tensorflow_datasets/datasets/pet_finder/pet_finder_dataset_builder.py
imports: from __future__ import annotations
  import os
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  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(csv_name, csv_paths, img_paths) without return types