class_docstr: Healthy and unhealthy plant leaves dataset.
class_docstr_tok: ["Healthy","and","unhealthy","plant","leaves","dataset","."]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, image_files):
      """Yields examples."""
      label_map = {pattern: label for pattern, label in _LABEL_MAPPING}
      regexp = re.compile(r"^(\w+[-_][dh])\d+\.JPG$")
      # Assigns labels to images based on label mapping.
      for original_fname, fpath in image_files.items():
          match = regexp.match(original_fname)
          if match and match.group(1) in label_map:
              label = label_map[match.group(1)]
              record = {
                  "image": fpath,
                  "image/filename": original_fname,
                  "label": label,
              }
              yield original_fname, record
  
file_path: datasets/tensorflow_datasets/datasets/plantae_k/plantae_k_dataset_builder.py
imports: import os
  import re
  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(image_files) without return types