def unsubscribe(self):
        self._subscription.unsubscribe()
        self._coordinator.close()
        self._client.cluster.need_all_topic_metadata = False
        self._client.set_topics([])
        log.debug("Unsubscribed all topics or patterns and assigned partitions")
Unsubscribe from all topics and clear all assigned partitions.
dataset/ETHPy150Open dpkp/kafka-python/kafka/consumer/group.py/KafkaConsumer.unsubscribe