def perform(self, msg, designated=False):
        """Take a given PERFORM message, add it to the set of decided commands,
        and call performcore to execute."""
        if self.debug: self.logger.write("State:", "Performing msg %s" % str(msg))
        if msg.commandnumber not in self.decisions:
            self.add_to_decisions(msg.commandnumber, msg.proposal)
        # If replica was using this commandnumber for a different proposal, initiate it again
        if msg.commandnumber in self.proposals and msg.proposal != self.proposals[msg.commandnumber]:
            self.pick_commandnumber_add_to_pending(self.proposals[msg.commandnumber])
            self.issue_pending_commands()

        while self.nexttoexecute in self.decisions:
            requestedcommand = self.decisions[self.nexttoexecute]
            if isinstance(requestedcommand, ProposalServerBatch):
                for command in requestedcommand.proposals:
                    self.execute_command(command, msg, designated)
            else:
                self.execute_command(requestedcommand, msg, designated)
            self.nexttoexecute += 1
            # the window just got bumped by one
            # check if there are pending commands, and issue one of them
            self.issue_pending_commands()
        if self.debug: self.logger.write("State", "Returning from PERFORM!")
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica.perform/original