def close(self):
        """Close the consumer, waiting indefinitely for any needed cleanup."""
        if self._closed:
            return
        log.debug("Closing the KafkaConsumer.")
        self._closed = True
        self._coordinator.close()
        self._metrics.close()
        self._client.close()
        try:
            self.config['key_deserializer'].close()
        except AttributeError:
            pass
        try:
            self.config['value_deserializer'].close()
        except __HOLE__:
            pass
        log.debug("The KafkaConsumer has closed.")
dataset/ETHPy150Open dpkp/kafka-python/kafka/consumer/group.py/KafkaConsumer.close