code: def test_encode_gif():
      """Test case for encode_gif."""
  
      # Image is taken from WIKI (Newton's Cradle: Newtons_cradle_animation_book_2.gif):
      # https://en.wikipedia.org/wiki/GIF
      batch = 36
      height = 360
      width = 480
      channel = 3
  
      path = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_image",
          "cradle.gif",
      )
  
      image = tf.image.decode_gif(tf.io.read_file(path))
      assert image.shape == (batch, height, width, channel)
      gif = tfio.image.encode_gif(image)
      encoded = tf.image.decode_gif(gif)
      assert np.allclose(image, encoded, atol=8.0)
  
imports: import os
  import numpy
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 17 for calling a global function with example usage: test_encode_gif() without return types