code: def unwrap(image):
      """Unwraps an image produced by wrap.
  
      Where there is a 0 in the last channel for every spatial position,
      the rest of the three channels in that spatial dimension are grayed
      (set to 128).  Operations like translate and shear on a wrapped
      Tensor will leave 0s in empty locations.  Some transformations look
      at the intensity of values to do preprocessing, and we want these
      empty pixels to assume the 'average' value, rather than pure black.
  
  
      Args:
        image: A 3D Image Tensor with 4 channels.
  
      Returns:
        image: A 3D image Tensor with 3 channels.
      """
      image_shape = tf.shape(image)
      # Flatten the spatial dimensions.
      flattened_image = tf.reshape(image, [-1, image_shape[2]])
  
      # Find all pixels where the last channel is zero.
      alpha_channel = tf.expand_dims(
          flattened_image[:, image_shape[2] - 1], 1
      )
  
      replace = tf.constant(
          [REPLACE_VALUE, REPLACE_VALUE, REPLACE_VALUE, 1], image.dtype
      )
  
      # Where they are zero, fill them in with 'replace'.
      flattened_image = tf.where(
          tf.equal(alpha_channel, 0),
          tf.ones_like(flattened_image, dtype=image.dtype) * replace,
          flattened_image,
      )
  
      image = tf.reshape(flattened_image, image_shape)
      image = tf.slice(
          image,
          [0, 0, 0],
          [image_shape[0], image_shape[1], image_shape[2] - 1],
      )
      return image
  
imports: import math
  import tensorflow
  import tensorflow_addons
label_desc: Use image node_id 3 for calling a global function with example usage: unwrap(image) and returns: image