code: def test_kafka_mini_dataset_size():
      """Test the functionality of batch.num.messages property of
      KafkaBatchIODataset/KafkaGroupIODataset.
      """
      import tensorflow_io.kafka as kafka_io
  
      # Write new messages to the topic
      for i in range(200, 10000):
          message = f"D{i}"
          kafka_io.write_kafka(
              message=message, topic="key-partition-test"
          )
  
      BATCH_NUM_MESSAGES = 5000
      dataset = tfio.experimental.streaming.KafkaBatchIODataset(
          topics=["key-partition-test"],
          group_id="cgminibatchsize",
          servers=None,
          stream_timeout=5000,
          configuration=[
              "session.timeout.ms=7000",
              "max.poll.interval.ms=8000",
              "auto.offset.reset=earliest",
              f"batch.num.messages={BATCH_NUM_MESSAGES}",
          ],
      )
      for mini_d in dataset:
          count = 0
          for _ in mini_d:
              count += 1
          assert count == BATCH_NUM_MESSAGES
          break
  
imports: import sys
  import time
  import pytest
  import numpy
  import threading
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 17 for calling a global function with example usage: test_kafka_mini_dataset_size() without return types