<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tryPrepare(self, pp: PrePrepare):
 """ Try to send the Prepare message if the PrePrepare message is ready to be passed into the Prepare phase. """

        rv, msg = self.canPrepare(pp)
        if rv:
            self.doPrepare(pp)
        else:
            self.logger.debug("{} cannot send PREPARE since {}".format(self, msg))