class_docstr: Street View House Numbers (SVHN) Dataset, cropped version.
docstr: Generate examples as dicts.
  
  Args:
    split_prefix: `str` prefix that identifies the split.
    filepath: `str` path of the file to process.
  
  Yields:
    Generator yielding the next samples
docstr_tok: ["Generate","examples","as","dicts",".","Args",":","split_prefix",":","`","str","`","prefix","that","identifies","the","split",".","filepath",":","`","str","`","path","of","the","file","to","process",".","Yields",":","Generator","yielding","the","next","samples"]
code: def _generate_examples(self, split_prefix, filepath):
      """Generate examples as dicts.
  
      Args:
        split_prefix: `str` prefix that identifies the split.
        filepath: `str` path of the file to process.
  
      Yields:
        Generator yielding the next samples
      """
      with tf.io.gfile.GFile(filepath, "rb") as f:
          data = tfds.core.lazy_imports.scipy.io.loadmat(f)
  
      # Maybe should shuffle ?
  
      assert np.max(data["y"]) <= 10  # Sanity check
      assert np.min(data["y"]) > 0
  
      for i, (image, label) in enumerate(
          zip(np.rollaxis(data["X"], -1), data["y"])
      ):
          label = label.reshape(())
          record = {
              "image": image,
              "label": label
              % 10,  # digit 0 is saved as 0 (instead of 10)
          }
          if self.version > "3.0.0":
              record["id"] = "{}{:06d}".format(split_prefix, i)
          yield i, record
  
file_path: datasets/tensorflow_datasets/datasets/svhn_cropped/svhn_cropped_dataset_builder.py
imports: import urllib
  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(split_prefix, filepath) without return types