def execute_command(self, requestedcommand, msg, designated):
        # commands are executed one by one here.
        if requestedcommand in self.executed:
            if self.debug: self.logger.write("State", "Previously executed command %d."
                                             % self.nexttoexecute)
            # Execute the metacommand associated with this command
            if WINDOW > self.nexttoexecute:
                if self.debug: self.logger.write("State",
                                                 "performcore %d" % (self.nexttoexecute-WINDOW))
                self.performcore(self.decisions[self.nexttoexecute-WINDOW], True)
            # If we are a leader, we should send a reply to the client for this command
            # in case the client didn't receive the reply from the previous leader
            if self.isleader:
                prevrcode, prevresult, prevunblocked = self.executed[requestedcommand]
                if prevrcode == CR_BLOCK:
                    # As dictionary is not sorted we have to start from the beginning every time
                    for resultset in self.executed.itervalues():
                        if resultset[EXC_UNBLOCKED] == requestedcommand:
                            # This client has been UNBLOCKED
                            prevresult = None
                            prevrcode = CR_UNBLOCK
                # Send a reply to the client only if there was a client
                if type(requestedcommand.command) == str:
                    commandname = requestedcommand.command
                else:
                    commandname = requestedcommand.command[0]
                if (commandname not in METACOMMANDS) and (commandname != 'noop'):
                    if self.debug: self.logger.write("State", "Sending reply to client.")
                    self.send_reply_to_client(prevrcode, prevresult, requestedcommand)
        elif requestedcommand not in self.executed:
            if self.debug: self.logger.write("State", "executing command %s." % str(requestedcommand))
            # check to see if there was a metacommand precisely WINDOW commands ago
            # that should now take effect
            # We are calling performcore 2 times, the timing gets screwed plus this
            # is very unefficient
            if self.nexttoexecute > WINDOW:
                if self.debug: self.logger.write("State", "performcore %d" % \
                                                     (self.nexttoexecute-WINDOW))
                if not (isinstance(self.decisions[self.nexttoexecute-WINDOW], ProposalServerBatch) or
                        isinstance(self.decisions[self.nexttoexecute-WINDOW], ProposalClientBatch)):
                    self.performcore(self.decisions[self.nexttoexecute-WINDOW], True,
                                     designated=designated)
            if self.debug: self.logger.write("State", "performcore %s" % str(requestedcommand))
            if isinstance(requestedcommand, ProposalClientBatch):
                self.performcore_clientbatch(requestedcommand, designated=designated)
            else:
                self.performcore(requestedcommand, designated=designated)
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica.execute_command/swapped operands of `>`