def handle_client_command_batch(self, msgconnlist, prepare=False):
        """handle received command
        - if it has been received before check if it has been executed
        -- if it has been executed send the result
        -- if it has not been executed yet send INPROGRESS
        - if this request has not been received before initiate a Paxos round for the command"""
        if not self.isleader:
            if self.debug: self.logger.write("Error",
                              "Should not have come here: Not Leader.")
            for (msg,conn) in msgconnlist:
                clientreply = create_message(MSG_CLIENTREPLY, self.me,
                                             {FLD_REPLY: '',
                                              FLD_REPLYCODE: CR_REJECTED,
                                              FLD_INRESPONSETO: msg.command.clientcommandnumber})
                conn.send(clientreply)
            return

        clientreply = None
        commandstohandle = []
        for (msg,conn) in msgconnlist:
            if msg.sendcount == 0:
                # The caller haven't received this command before
                self.receivedclientrequests[(msg.command.client,
                                             msg.command.clientcommandnumber)] = msg.command
                commandstohandle.append(msg.command)
                continue
            if (msg.command.client, msg.command.clientcommandnumber) in self.receivedclientrequests:
                if self.debug: self.logger.write("State", "Client request received previously:")
                # Check if the request has been executed
                if msg.command in self.executed:
                    # send REPLY
                    clientreply = create_message(MSG_CLIENTREPLY, self.me,
                                                 {FLD_REPLY: self.executed[msg.command][EXC_RESULT],
                                                  FLD_REPLYCODE: self.executed[msg.command][EXC_RCODE],
                                                  FLD_INRESPONSETO: msg.command.clientcommandnumber})
                    if self.debug: self.logger.write("State", "Clientreply: %s" % str(clientreply))
                # Check if the request is somewhere in the Paxos pipeline
                elif msg.command in self.pendingcommandset or msg.command in self.proposalset \
                        or msg.command in self.decisionset:
                    # send INPROGRESS
                    clientreply = create_message(MSG_CLIENTREPLY, self.me,
                                                 {FLD_REPLY: '',
                                                  FLD_REPLYCODE: CR_INPROGRESS,
                                                  FLD_INRESPONSETO: msg.command.clientcommandnumber})
                    if self.debug: self.logger.write("State", "Clientreply: %s\nReplicas: %s"
                                      % (str(clientreply),str(self.replicas)))
                if clientreply:
                    conn.send(clientreply)
        if self.debug: self.logger.write("State", self.active % "Initiating a new command. Leader is active: %s")
        # Check if batching is still required
        if len(commandstohandle) == 0:
            return
        elif len(commandstohandle) == 1:
            self.pick_commandnumber_add_to_pending(commandstohandle[0])
        else:
            self.pick_commandnumber_add_to_pending(ProposalServerBatch(commandstohandle))
        self.issue_pending_commands()
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica.handle_client_command_batch/swapped operands of `%`