code: def get_image_array_from_example(example):
      """Decode image/encoded and image/shape of an Example into a numpy array.
  
      Parse image/encoded and image/shape features from a tensorflow Example and
      decode the image into that shape.
  
      Args:
        example: a tensorflow Example containing features that include
          "image/encoded" and "image/shape"
  
      Returns:
        numpy array of dtype np.uint8.
      """
      features = example.features.feature
      img = features["image/encoded"].bytes_list.value[0]
      shape = features["image/shape"].int64_list.value[0:3]
      return np.frombuffer(img, np.uint8).reshape(shape)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  import math
  from typing import List, NamedTuple, Tuple
  from etils import epath
  from IPython import display
  import numpy
  from PIL import Image
  from PIL import ImageDraw
  from third_party.nucleus.protos import variants_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: get_image_array_from_example(example) and returns: np