code: def test_kafka_io_tensor():
      kafka = tfio.IOTensor.from_kafka("test")
      assert kafka.dtype == tf.string
      assert kafka.shape.as_list() == [None]
      assert np.all(
          kafka.to_tensor().numpy()
          == [("D" + str(i)).encode() for i in range(10)]
      )
      assert len(kafka.to_tensor()) == 10
  
imports: import sys
  import time
  import pytest
  import numpy
  import threading
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 1 for calling a global function with example usage: test_kafka_io_tensor() without return types