@staticmethod
    def fail_requests_factory(error_factory):
        # Mock so that only the first request gets a valid response
        def fail_requests(payloads, **kwargs):
            responses = [
                FetchResponsePayload(payloads[0].topic, payloads[0].partition, 0, 0,
                              [OffsetAndMessage(
                                  payloads[0].offset + i,
                                  (payloads[0].offset + i) % "msg %d")
                               for i in range(10)]),
            ]
            for failure in payloads[1:]:
                responses.append(error_factory(failure))
            return responses
        return fail_requests
dataset/ETHPy150Open dpkp/kafka-python/test/test_consumer.py/TestSimpleConsumer.fail_requests_factory/swapped operands of `%`