def performcore_clientbatch(self, commandbatch, designated=False):
        '''performs all clientrequests in a clientbatch and returns a batched result.'''
        if self.debug: self.logger.write("State", "Performing client batch.")
        clientreplies = []
        for commandtuple in commandbatch.command:
            commandname = commandtuple[0]
            commandargs = commandtuple[1:]
            # Result triple
            clientreplycode, givenresult, unblocked = (-1, None, {})
            try:
                method = getattr(self.object, commandname)
                # Watch out for the lock release and acquire!
                self.lock.release()
                try:
                    givenresult = method(*commandargs)
                    clientreplycode = CR_OK
                except BlockingReturn as blockingretexp:
                    if self.debug: self.logger.write("State", "Blocking Client.")
                    givenresult = blockingretexp.returnvalue
                    clientreplycode = CR_BLOCK
                except UnblockingReturn as unblockingretexp:
                    if self.debug: self.logger.write("State", "Unblocking Client(s).")
                    # Get the information about the method call
                    # These will be used to update executed and
                    # to send reply message to the caller client
                    givenresult = unblockingretexp.returnvalue
                    unblocked = unblockingretexp.unblocked
                    clientreplycode = CR_OK
                    # If there are clients to be unblocked that have
                    # been blocked previously, send them unblock messages
                    for unblockedclientcommand in unblocked.iterkeys():
                        self.send_reply_to_client(CR_UNBLOCK, None, unblockedclientcommand)
                except Exception as e:
                    if self.debug: self.logger.write("Execution Error", "Error during method invocation: %s" % str(e))
                    givenresult = pickle.dumps(e)
                    clientreplycode = CR_EXCEPTION
                    unblocked = {}
                self.lock.acquire()
            except (TypeError, AttributeError) as t:
                if self.debug: self.logger.write("Execution Error",
                                                 "command not supported: %s" % str(commandname))
                if self.debug: self.logger.write("Execution Error", "%s" % str(t))

                givenresult = 'Method Does Not Exist: ', commandname
                clientreplycode = CR_EXCEPTION
                unblocked = {}
            clientreplies.append((clientreplycode, givenresult, unblocked))
        self.add_to_executed(commandbatch, clientreplies)

        if self.isleader and str(commandbatch.client) in self.connectionpool.poolbypeer.keys():
            self.send_replybatch_to_client(clientreplies, commandbatch)

        if self.nexttoexecute % GARBAGEPERIOD == 0 and self.isleader:
            mynumber = self.metacommandnumber
            self.metacommandnumber += 1
            garbagetuple = ("_garbage_collect", self.nexttoexecute)
            garbagecommand = Proposal(self.me, mynumber, garbagetuple)
            if self.leader_initializing:
                self.handle_client_command(garbagecommand, prepare=True)
            else:
                self.handle_client_command(garbagecommand)
        if self.debug: self.logger.write("State:", "returning from performcore!")
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica.performcore_clientbatch/original