code: def test_kafka_producer_gc_cleanup():
      gc.collect()
      threads = threading.active_count()
      producer = KafkaProducer(
          api_version="0.9"
      )  # set api_version explicitly to avoid auto-detection
      assert threading.active_count() == threads + 1
      del producer
      gc.collect()
      assert threading.active_count() == threads
  
file_path: kafka-python/test/test_producer.py
imports: import gc
  import platform
  import time
  import threading
  import pytest
  from kafka import KafkaConsumer, KafkaProducer, TopicPartition
  from kafka.producer.buffer import SimpleBufferPool
  from test.testutil import env_kafka_version, random_string
label_desc: Use image node_id 3 for calling a global function with example usage: test_kafka_producer_gc_cleanup() without return types