class_docstr: Places365 Images dataset.
code: def _generate_examples(
      self, archive, path_prefix, split_name, annotation_path
  ):
      with epath.Path(annotation_path).open() as f:
          if split_name == "test":
              # test split doesn't have labels assigned.
              file_to_class = {
                  x[0]: -1 for x in csv.reader(f, delimiter=" ")
              }
          else:
              file_to_class = {
                  x[0]: int(x[1]) for x in csv.reader(f, delimiter=" ")
              }
  
      for fname, fobj in archive:
          fname = fname.replace("\\", "/")  # For windows compatibility
          assert fname.startswith(path_prefix)
          # The filenames in annotations for train start with "/" while the names
          # for test and validation do not have a leading "/", so we chop
          # differently.
          chop = (
              len(path_prefix)
              if split_name == "train"
              else len(path_prefix) + 1
          )
          key = fname[chop:]
          class_id = file_to_class[key]
          yield fname, {
              "image": fobj,
              "label": class_id,
              "filename": fname,
          }
  
file_path: datasets/tensorflow_datasets/datasets/places365_small/places365_small_dataset_builder.py
imports: import csv
  import os
  from etils import epath
  import six.moves.urllib
  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(archive, path_prefix, split_name, annotation_path) without return types