'Get the TopicPartitions currently assigned to this consumer.
If partitions were directly assigned using
:meth:`~kafka.KafkaConsumer.assign`, then this will simply return the
same partitions that were previously assigned.  If topics were
subscribed using :meth:`~kafka.KafkaConsumer.subscribe`, then this will
give the set of topic partitions currently assigned to the consumer
(which may be None if the assignment hasn\'t happened yet, or if the
partitions are in the process of being reassigned).
Returns:
set: {TopicPartition, ...}'

def assignment(self):

    return self._subscription.assigned_partitions()
