from kafkatest.services.kafka import KafkaService # create a KafkaService instance service = KafkaService() # stop the Kafka node with hostname 'node-1' using a clean shutdown service.stop_node(node='node-1', clean_shutdown=True) # stop the Kafka node with hostname 'node-2' using a forceful shutdown service.stop_node(node='node-2', clean_shutdown=False)In the above example, we create an instance of `KafkaService` and use its `stop_node` method to stop two Kafka nodes in the cluster. Package library: `kafkatest.services.kafka`.