code: def unsubscribe(self):
          
          self.subscription = None
          self._user_assignment.clear()
          self.assignment.clear()
          self.subscribed_pattern = None
docs: Clear all topic subscriptions and partition assignments