code: def client(mocker):
      _cli = mocker.Mock(
          spec=KafkaClient(bootstrap_servers=(), api_version=(0, 9))
      )
      _cli.cluster = mocker.Mock(spec=ClusterMetadata())
      return _cli
  
file_path: kafka-python/test/test_sender.py
imports: from __future__ import absolute_import
  import pytest
  import io
  from kafka.client_async import KafkaClient
  from kafka.cluster import ClusterMetadata
  from kafka.metrics import Metrics
  from kafka.protocol.produce import ProduceRequest
  from kafka.producer.record_accumulator import RecordAccumulator, ProducerBatch
  from kafka.producer.sender import Sender
  from kafka.record.memory_records import MemoryRecordsBuilder
  from kafka.structs import TopicPartition
label_desc: Use image node_id 1 for calling a global function with example usage: client(mocker) and returns: _cli