code: def record_parse(
      serialized_example: str, image_shape: Tuple[int, int, int]
  ):
      features = tf.io.parse_single_example(
          serialized_example,
          features={
              "image": tf.io.FixedLenFeature([], tf.string),
              "label": tf.io.FixedLenFeature([], tf.int64),
          },
      )
      image = tf.image.decode_image(features["image"]).set_shape(
          image_shape
      )
      image = tf.cast(image, tf.float32) * (2.0 / 255) - 1.0
      return dict(image=image, label=features["label"])
  
file_path: privacy/research/mi_lira_2021/dataset.py
imports: from typing import Callable, Optional, Tuple, List
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: record_parse(serialized_example, image_shape) and returns: dict