class_docstr: Shape/Texture conflict .
class_docstr_tok: ["Shape\/Texture","conflict","."]
docstr: Generate images and labels for splits.
docstr_tok: ["Generate","images","and","labels","for","splits","."]
code: def _generate_examples(self, data_dir_path, imagenet_mapping_path):
      """Generate images and labels for splits."""
      # Read ImageNet mapping.
      imagenet_names = set(
          self.info.features["shape_imagenet_labels"].names
      )
  
      with epath.Path(imagenet_mapping_path).open() as f:
          mapping_txt = f.read()
      mapping = {}
      for match in re.finditer(
          r"([a-z]+)\s*=\s*\[([^\]]+)\]", mapping_txt
      ):
          mapping[match.group(1)] = list(
              sorted(
                  imagenet_names.intersection(
                      re.sub(r"\s", "", match.group(2)).split(",")
                  )
              )
          )
  
      # Process images.
      for shape_class_name in tf.io.gfile.listdir(data_dir_path):
          class_dir_path = os.path.join(data_dir_path, shape_class_name)
          for image_name in tf.io.gfile.listdir(class_dir_path):
              image = os.path.join(class_dir_path, image_name)
              texture_class_name = re.search(
                  "-([a-z]+)", image_name
              ).group(
                  1
              )  # pytype: disable=attribute-error
              yield image_name, {
                  "image": image,
                  "file_name": image_name,
                  "shape_label": shape_class_name,
                  "shape_imagenet_labels": mapping[shape_class_name],
                  "texture_label": texture_class_name,
                  "texture_imagenet_labels": mapping[
                      texture_class_name
                  ],
              }
  
file_path: datasets/tensorflow_datasets/image_classification/geirhos_conflict_stimuli.py
imports: import os
  import re
  from etils import epath
  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 GeirhosConflictStimuli obj's underlying member method code with example usage: obj._generate_examples(data_dir_path, imagenet_mapping_path) without return types