code: def get_validation_labels(val_path):
      """Returns labels for validation.
  
      Args:
        val_path: path to TAR file containing validation images. It is used to
          retrieve the name of pictures and associate them to labels.
  
      Returns:
        dict, mapping from image name (str) to label (str).
      """
      labels_path = tfds.core.tfds_path(_VALIDATION_LABELS_FNAME)
      with tf.io.gfile.GFile(os.fspath(labels_path)) as labels_f:
          # `splitlines` to remove trailing `\r` in Windows
          labels = labels_f.read().strip().splitlines()
      with tf.io.gfile.GFile(val_path, "rb") as tar_f_obj:
          tar = tarfile.open(mode="r:", fileobj=tar_f_obj)
          images = sorted(tar.getnames())
      return dict(zip(images, labels))
  
imports: import os
  import tarfile
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling a global function with example usage: get_validation_labels(val_path) and returns: dict