code: def compact(self, revision, physical=False):
          
          compact_request = etcdrpc.CompactionRequest(revision=revision,
                                                      physical=physical)
          self.kvstub.Compact(
              compact_request,
              self.timeout,
              credentials=self.call_credentials,
              metadata=self.metadata
          )
docs: Compact the event history in etcd up to a given revision.
  
          All superseded keys with a revision less than the compaction revision
          will be removed.
  
          :param revision: revision for the compaction operation
          :param physical: if set to True, the request will wait until the
                           compaction is physically applied to the local database
                           such that compacted entries are totally removed from
                           the backend database