class_docstr: Natural adversarial examples with ImageNet labels.
docstr: Yields the examples.
docstr_tok: ["Yields","the","examples","."]
code: def _generate_examples(self, imagenet_a_root):
      """Yields the examples."""
      # The directory structure is `imagenet-a/imagenet_synset_id/filename.jpg`.
      for class_synset in tf.io.gfile.listdir(imagenet_a_root):
          class_dir = os.path.join(imagenet_a_root, class_synset)
          if not tf.io.gfile.isdir(class_dir):
              continue
          for image_filename in tf.io.gfile.listdir(class_dir):
              image_path = os.path.join(class_dir, image_filename)
              features = {
                  "image": image_path,
                  "label": class_synset,
                  "file_name": image_filename,
              }
              yield image_filename, features
  
file_path: datasets/tensorflow_datasets/datasets/imagenet_a/imagenet_a_dataset_builder.py
imports: import os
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.datasets.imagenet2012 import imagenet_common
  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(imagenet_a_root) without return types