code: def _walk_omniglot_dir(directory):
      """Walk an Omniglot directory and yield examples."""
      directory = os.path.join(
          directory, tf.io.gfile.listdir(directory)[0]
      )
      alphabets = sorted(tf.io.gfile.listdir(directory))
      for alphabet in alphabets:
          alphabet_dir = os.path.join(directory, alphabet)
          characters = sorted(tf.io.gfile.listdir(alphabet_dir))
          for character in characters:
              character_id = int(character[len("character") :]) - 1
              character_dir = os.path.join(alphabet_dir, character)
              images = tf.io.gfile.listdir(character_dir)
              for image in images:
                  label, _ = image.split("_")
                  label = int(label) - 1
                  image_path = os.path.join(character_dir, image)
                  image_id = "%s_%d_%s" % (
                      alphabet,
                      character_id,
                      image,
                  )
                  yield alphabet, character_id, label, image_path, image_id
  
file_path: datasets/tensorflow_datasets/image_classification/omniglot.py
imports: import os
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 1 for calling a global function with example usage: _walk_omniglot_dir(directory) without return types