code: def canCommit(self, prepare: Prepare) -> (bool, str):
          
          quorum = self.quorums.prepare.value
          if not self.prepares.hasQuorum(prepare, quorum):
              return False, 'does not have prepare quorum for {}'.format(prepare)
          if self.hasCommitted(prepare):
              return False, 'has already sent COMMIT for {}'.format(prepare)
          return True, ''
docs: Return whether the specified PREPARE can proceed to the Commit
          step.
  
          Decision criteria:
  
          - If this replica has got just n-f-1 PREPARE requests then commit request.
          - If less than n-f-1 PREPARE requests then probably there's no consensus on
              the request; don't commit
          - If more than n-f-1 then already sent COMMIT; don't commit
  
          :param prepare: the PREPARE