docs: def commit(self, partitions=None):
          """Commit stored offsets to Kafka via OffsetCommitRequest (v0)
  
          Keyword Arguments:
              partitions (list): list of partitions to commit, default is to commit
                  all of them
  
          Returns: True on success, False on failure
          """
  
          # short circuit if nothing happened. This check is kept outside
          # to prevent un-necessarily acquiring a lock for checking the state
          if self.count_since_commit == 0:
              return
  
          with self.commit_lock:
              # Do this check again, just in case the state has changed
              # during the lock acquiring timeout
              if self.count_since_commit == 0:
                  return
  
              reqs = []
              if partitions is None:  # commit all partitions
                  partitions = list(self.offsets.keys())
  
              log.debug('Committing new offsets for %s, partitions %s',
                        self.topic, partitions)
              for partition in partitions:
                  offset = self.offsets[partition]
                  log.debug('Commit offset %d in SimpleConsumer: '
                            'group=%s, topic=%s, partition=%s',
                            offset, self.group, self.topic, partition)
  
                  reqs.append(OffsetCommitRequest(self.topic, partition,
                                                  offset, None))
  
              try:
                  self.client.send_offset_commit_request(self.group, reqs)
              except KafkaError as e:
                  log.error('%s saving offsets: %s', e.__class__.__name__, e)
                  return False
              else:
                  self.count_since_commit = 0
                  return True