code: def test_avro_encode_decode():
      """test_avro_encode_decode"""
      schema = (
          '{"type":"record","name":"myrecord","fields":'
          '[{"name":"f1","type":"string"},{"name":"f2","type":"long"}]}'
      )
      value = [("value1", 1), ("value2", 2), ("value3", 3)]
      f1 = tf.cast([v[0] for v in value], tf.string)
      f2 = tf.cast([v[1] for v in value], tf.int64)
      message = tfio.experimental.serialization.encode_avro(
          [f1, f2], schema=schema
      )
      entries = tfio.experimental.serialization.decode_avro(
          message, schema=schema
      )
      assert np.all(entries["f1"].numpy() == f1.numpy())
      assert np.all(entries["f2"].numpy() == f2.numpy())
  
imports: import sys
  import time
  import pytest
  import numpy
  import threading
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 6 for calling a global function with example usage: test_avro_encode_decode() without return types