def handle_request(self, msgtype, msgid, method, args, kwargs):
        response = None
        error = None
        exception = None

        try:
            response = self.dispatch.call(method, args, kwargs)
        except Exception as e:
            error = (e.__class__.__name__, str(e))
            exception = e

        if isinstance(response, Deferred):
            response.add_callback(self.send_response, msgid)
            response.add_errback(self.send_error, msgid)
        else:
            if exception is None:
                self.send_response(msgid, response)
            else:
                self.send_error(msgid, exception)
Returns a randomly chosen batch of data formatted as a design
dataset/ETHPy150Open bfrog/whizzer/whizzer/rpc/picklerpc.py/PickleProtocol.handle_request--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/dataset.py/Dataset.get_batch_design