'Clear all topic subscriptions and partition assignments'

def unsubscribe(self):

    self.subscription = None
    self._user_assignment.clear()
    self.assignment.clear()
    self.needs_partition_assignment = True
    self.subscribed_pattern = None
